Skip to content

Instantly share code, notes, and snippets.

@boldfacedesign
Created January 28, 2014 17:05
Show Gist options
  • Save boldfacedesign/8671774 to your computer and use it in GitHub Desktop.
Save boldfacedesign/8671774 to your computer and use it in GitHub Desktop.
JavaScript sleep (wait) function
function sleep(milliseconds) {
var startTime = new Date().getTime();
while (new Date().getTime() < startTime + milliseconds);
}
sleep(10000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment