Created
March 30, 2018 10:52
-
-
Save gasparrobi/0ee6bf03435ee804869509b3ed25d8c9 to your computer and use it in GitHub Desktop.
async setTimeout
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 wait = ms => new Promise(resolve => setTimeout(resolve, ms)); | |
async function main() { | |
console.log("waiting ...."); | |
await wait(5000); | |
console.log("5 seconds have passed!"); | |
} | |
main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment