nodejs parallel async calls 1

Solutions on MaxInterview for nodejs parallel async calls 1 by the best coders in the world

showing results for - "nodejs parallel async calls 1"
Fabio
27 Nov 2019
1async function sleep(time = 1) {
2	const sleepMilliseconds = time * 1000
3	
4	return new Promise(resolve => {
5		setTimeout(() => {
6			resolve(`Slept for: ${sleepMilliseconds}ms`)
7		}, sleepMilliseconds)
8	})
9}