Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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