Skip to content

Instantly share code, notes, and snippets.

@gskachkov
Created September 15, 2017 14:48
Show Gist options
  • Save gskachkov/b638b2b8100214d487f28937aae6f4cb to your computer and use it in GitHub Desktop.
Save gskachkov/b638b2b8100214d487f28937aae6f4cb to your computer and use it in GitHub Desktop.
async function asyncFoo(i) {
return Promise.resolve(i);
}
async function main() {
console.log(`Start`);
const start = Date.now()
let total = 0
for (let i = 0;i < 550000; i++) {
total += await asyncFoo(i);
}
const end = Date.now()
console.log(`Total: ${ total }`)
console.log(`Time Taken: ${ end - start }`)
}
main();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment