Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

nodejs parallel async calls -1

async function sleep(time = 1) {
	const sleepMilliseconds = time * 1000
	
	return new Promise(resolve => {
		setTimeout(() => {
			resolve(`Slept for: ${sleepMilliseconds}ms`)
		}, sleepMilliseconds)
	})
}
Source by programmingwithswift.com #
 
PREVIOUS NEXT
Tagged: #nodejs #parallel #async #calls
ADD COMMENT
Topic
Name
1+9 =