Created
October 29, 2019 13:04
-
-
Save eiel/e25ae3b30b219a07f90a876b09fbf689 to your computer and use it in GitHub Desktop.
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
function sleep(n) { | |
return new Promise(resolve => setTimeout(resolve, n)); | |
} | |
(async () => { | |
console.log(Date.now()); | |
await sleep(1000); | |
console.log(Date.now()); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment