-
Notifications
You must be signed in to change notification settings - Fork 0
sleep
Subhajit Sahu edited this page Aug 1, 2022
·
1 revision
Sleep for specified time (async).
function sleep(ms)
// ms: time in milliseconds
const {sleep} = require('extra-sleep');
async function main() {
console.log('Turn on Alarm');
// → Turn on Alarm
await sleep(1000);
console.log('Turn on Shower');
// → Turn on Shower (after 1s)
}