Created
May 10, 2012 08:26
-
-
Save dsheiko/2651876 to your computer and use it in GitHub Desktop.
JS port of PHP's sleep function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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