Last active
August 7, 2018 03:15
-
-
Save gchavez2/24150d9258317c12c527827223e30802 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Implementation | |
function sleep(ms){ | |
return new Promise(resolve=>{ | |
setTimeout(resolve,ms) | |
}) | |
} | |
// Usage. Sleep two seconds | |
await sleep(2000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment