Snippets Collections
function timeout(ms) {
  return new Promise(resolve => setTimeout(resolve, ms));
}

await timeout(1000); // pauses execution for 1000ms
star

Mon Mar 29 2021 17:30:16 GMT+0000 (UTC)

#javascript #node #sleep

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension