Created
November 13, 2015 13:55
-
-
Save eteeselink/81314282c95cd692ea1d to your computer and use it in GitHub Desktop.
ES7 async/await version of 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 delay = ms => new Promise(resolve => setTimeout(resolve, ms)); | |
async function something() { | |
console.log("this might take some time...."); | |
await delay(5000); | |
console.log("done!") | |
} | |
something(); |
thanks!
thank you
Gracias 😃
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thank you very much