📅  最后修改于: 2022-03-11 15:02:41.408000             🧑  作者: Mango
//you can leave the sleep constant
const sleep = (milliseconds) => {
return new Promise(resolve => setTimeout(resolve, milliseconds))
}
const doSomething = async () => {
for (/*for loop statements here*/) {
//code before sleep goes here, just change the time below in milliseconds
await sleep(1000)
//code after sleep goes here
}
}
doSomething();