Created
June 30, 2018 06:28
-
-
Save rupakg/5c3d2e94cb9396f694a56262e4611cb0 to your computer and use it in GitHub Desktop.
delay using await
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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