SyntaxFix
Write A Post
Hire A Developer
Questions
A naive, CPU-intensive method to block execution for a number of milliseconds:
/** * Delay for a number of milliseconds */ function sleep(delay) { var start = new Date().getTime(); while (new Date().getTime() < start + delay); }