promises.js
// Synchronous wait to simulate a long action
Synchronous wait to simulate a long action
Synchronous wait to simulate a long action
function wait(ms) {
	var start = Date.now(), now = start;
	while (now - start < ms) {
		now = Date.now();
	}
}
function wait ( ms ) { var start = Date . now ( ) , now = start ; while ( now - start < ms ) { now = Date . now ( ) ; } }
Synchronous wait to simulate a long action
Synchronous wait to simulate a long action