Last active
April 29, 2018 11:56
-
-
Save AshanthaLahiru/bffae20175e4595ecfe9b7d48185e3ad to your computer and use it in GitHub Desktop.
Promise performance
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
Promise.all([promise(1000), promise(2000), promise(3000)]) | |
.then((msgs) => { | |
msgs.forEach(msg => { | |
console.log(msg) | |
}); | |
console.log(`End of Promise.all(..)`) | |
}) | |
//Result | |
/* | |
Promise 1000 start | |
Promise 2000 start | |
Promise 3000 start | |
Promise 1000 end | |
Promise 2000 end | |
Promise 3000 end | |
End of Promise.all(..) | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment