showing results for - "nodejs parallel async calls 2"
Isaac
22 Nov 2017
1async function main() {
2	// 1. 
3	console.time('main')
4
5	// 2.
6	const [firstCall, secondCall, thirdCall] = await Promise.all([
7		sleep(1), 
8		sleep(2),
9		sleep(3)
10	])
11	console.log(`First call: ${firstCall}`)
12	console.log(`Second call: ${secondCall}`)
13	console.log(`Third call: ${thirdCall}`)
14
15	// 3.
16	console.timeEnd('main')
17}
18
19main()