creamy-airplane-93471
07/25/2023, 8:52 AMcreamy-airplane-93471
07/25/2023, 9:51 AMacceptable-kangaroo-64719
07/25/2023, 10:53 AMjs
async function waitNSeconds(n) {
return new Promise((resolve) => {
setTimeout(() => {
resolve()
}, n)
})
}
// Usage
console.log('Start waiting...')
await waitNSeconds(10000) // 10000 milliseconds = 10 seconds
This will wait 10 seconds. You can change the duration by modifying the last line. 10,000 = 10 seconds; 5,000 = 5 sec, etcmysterious-action-40978
08/25/2023, 1:10 PMmysterious-action-40978
08/25/2023, 1:11 PM