Skip to content

Instantly share code, notes, and snippets.

@fauxsaurus
Created June 25, 2019 16:11
Show Gist options
  • Save fauxsaurus/12c401b3befb00e904eb5c155665ca08 to your computer and use it in GitHub Desktop.
Save fauxsaurus/12c401b3befb00e904eb5c155665ca08 to your computer and use it in GitHub Desktop.
A simple wait/sleep command in JavaScript.
await new Promise(done=>setTimeout(done,seconds*1000))
//note: replace "seconds" with a number to use this
//hint: this will only work inside an async function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment