Skip to content

Instantly share code, notes, and snippets.

@yeonwooz
Created March 14, 2022 11:23
Show Gist options
  • Save yeonwooz/1f8fac5e28c93d7426bac795da6f24c2 to your computer and use it in GitHub Desktop.
Save yeonwooz/1f8fac5e28c93d7426bac795da6f24c2 to your computer and use it in GitHub Desktop.
promise all
async function usePromiseAll() {
console.time('a')
const res1 = bar(5)
const res2 = car(res1)
const res = await Promise.all([res1, res2])
console.log(res)
console.timeEnd('a') // 2000ms
}
usePromiseAll()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment