Skip to content

Instantly share code, notes, and snippets.

@dsheiko
Created May 10, 2012 08:26
Show Gist options
  • Save dsheiko/2651876 to your computer and use it in GitHub Desktop.
Save dsheiko/2651876 to your computer and use it in GitHub Desktop.
JS port of PHP's sleep function
var sleep = function(millis) {
var date = new Date();
var curDate = null;
do { curDate = new Date(); }
while(curDate-date < millis);
return this;
}
sleep(1500).alert("Script is released");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment