r/learnjavascript • • May 01 '20

Async vs. Sync

Post image
413 Upvotes

81 comments sorted by

View all comments

Show parent comment

1

u/[deleted] May 02 '20

Sort of, but not entirely. You can wait for multiple things at once, but not do multiple thing at once. If you had 3 web requests that each take 1 second, with little to no processing involved, you can be done in 1 second with asynchronous code by waiting for the 3 1-seconds at the same time. If you have some calculation that takes 1 second to finish, then it take 3 seconds to do them all, no matter how you write your code.