Another user posted here this snippet for time delay, I havent tested it:
async function waitNSeconds(n) {
return new Promise((resolve) => {
setTimeout(() => {
resolve()
}, n)
})
}
// Usage
console.log('Start waiting...')
await waitNSeconds(5000) // 5000 = 5s adjust waiting time here