Skip to content

Instantly share code, notes, and snippets.

@saml
Created August 3, 2017 20:39
Show Gist options
  • Save saml/1e619dd238fe3e83c293e4539db5f530 to your computer and use it in GitHub Desktop.
Save saml/1e619dd238fe3e83c293e4539db5f530 to your computer and use it in GitHub Desktop.
const loading = new Promise(resolve => setTimeout(resolve, 3000));
async function f() {
await loading;
return 1;
}
(async function() {
console.log(new Date().toJSON(), process.pid, 'hello');
for (let i = 0; i < 100000000; i++) {
const x = await f();
console.log(new Date().toJSON(), process.pid, x);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment