Skip to content

Instantly share code, notes, and snippets.

@rupakg
Created June 30, 2018 06:28
Show Gist options
  • Save rupakg/5c3d2e94cb9396f694a56262e4611cb0 to your computer and use it in GitHub Desktop.
Save rupakg/5c3d2e94cb9396f694a56262e4611cb0 to your computer and use it in GitHub Desktop.
delay using await
// define
const delay = ms => new Promise(res => setTimeout(res, ms))
// call
await delay(5000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment