📅  最后修改于: 2022-03-11 15:01:12.198000             🧑  作者: Mango
async function sleep(time = 1) {
const sleepMilliseconds = time * 1000
return new Promise(resolve => {
setTimeout(() => {
resolve(`Slept for: ${sleepMilliseconds}ms`)
}, sleepMilliseconds)
})
}