练习手写sleep

function sleep (tm) {
	return new Promise(resolve => setTimerout(resolve, tm))
}

sleep(2000).then(() => {console.log('hhah')})

你可能感兴趣的:(随笔,js)