Skip to content

Instantly share code, notes, and snippets.

@gasparrobi
Created March 30, 2018 10:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gasparrobi/0ee6bf03435ee804869509b3ed25d8c9 to your computer and use it in GitHub Desktop.
Save gasparrobi/0ee6bf03435ee804869509b3ed25d8c9 to your computer and use it in GitHub Desktop.
async setTimeout
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