Implementing a sleep() function in JavaScript
Note: usually, it’s better to use an asynchronous function, like setTimeout(), because this function blocks execution until it’s finished. That being said, sometimes you need to add a busy wait loop into your scripts. And this is how:
[Via http://stackoverflow.com/questions/16873323/javascript-sleep-wait-before-continuing]
Comments