Skip to content

Instantly share code, notes, and snippets.

@eiel
Created October 29, 2019 13:04
Show Gist options
  • Save eiel/e25ae3b30b219a07f90a876b09fbf689 to your computer and use it in GitHub Desktop.
Save eiel/e25ae3b30b219a07f90a876b09fbf689 to your computer and use it in GitHub Desktop.
function sleep(n) {
return new Promise(resolve => setTimeout(resolve, n));
}
(async () => {
console.log(Date.now());
await sleep(1000);
console.log(Date.now());
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment