Created
March 10, 2021 14:49
-
-
Save thewhodidthis/b47b1a2675a1b51dbf392a4b7663e6c2 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
/* | |
const run = async () => { | |
await sleep(1000) | |
console.log("One") | |
await sleep(1000) | |
console.log("Two") | |
} | |
run() | |
*/ | |
const sleep = (delay) => new Promise((resolve) => setTimeout(resolve, delay)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment