Skip to content

Instantly share code, notes, and snippets.

@think2011
Created April 15, 2017 12:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save think2011/31ab7678c680147566db4ddfb0974120 to your computer and use it in GitHub Desktop.
Save think2011/31ab7678c680147566db4ddfb0974120 to your computer and use it in GitHub Desktop.
while sleep
const sleep = (n) => {
let start = Date.now()
while(true) if (Date.now() - start > n) break
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment