You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
331 B
16 lines
331 B
// // sleep function |
|
// const sleep = (milliseconds) => { |
|
// const date = Date.now() |
|
// let currentDate = null |
|
// do { |
|
// currentDate = Date.now() |
|
// } while (currentDate - date < milliseconds) |
|
// } |
|
|
|
const sleep = (ms) => { |
|
return new Promise(resolve => setTimeout(resolve, ms)) |
|
} |
|
|
|
module.exports = { |
|
sleep: sleep |
|
} |