Skip to content

Instantly share code, notes, and snippets.

@FrankFang
Created December 5, 2013 08:14
Show Gist options
  • Save FrankFang/7801828 to your computer and use it in GitHub Desktop.
Save FrankFang/7801828 to your computer and use it in GitHub Desktop.
JS sleep
function sleep(millis){
var date = new Date();
var currentDate = null;
do { currentDate = new Date(); }
while(currentDate - date < millis);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment