Created
September 15, 2017 14:48
-
-
Save gskachkov/b638b2b8100214d487f28937aae6f4cb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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