function sleep(time) {
return new Promise((resolve, reject) => {
setTimeout(resolve, time)
})
}
async function cycle() {
const timeToSleep = 1000
console.log('start')
await sleep(timeToSleep)
for (const value of [0,1,2,3,4,5,6]) {
console.log(value)
await sleep(timeToSleep)
}
console.log('stop')
}