function delay(interval = 0) {
return new Promise(resolve => {
let timer = setTimeout(_ => {
clearTimeout(timer)
resolve()
}, interval)
})
}
设置异步间隔延迟
最新推荐文章于 2024-11-11 19:29:13 发布
function delay(interval = 0) {
return new Promise(resolve => {
let timer = setTimeout(_ => {
clearTimeout(timer)
resolve()
}, interval)
})
}