Created
March 6, 2019 20:09
-
-
Save kenmorechalfant/d2f190cddd6e875cd3151e10666e3a41 to your computer and use it in GitHub Desktop.
(async/await) wait / sleep
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
let wait = ms => new Promise((r, j)=>setTimeout(r, ms)); | |
await wait(2000); // sleep for 2 seconds |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment