9 lines
185 B
JavaScript
9 lines
185 B
JavaScript
|
|
||
|
|
||
|
module.exports.timeout = ms =>
|
||
|
new Promise(resolve => setTimeout(resolve, ms));
|
||
|
|
||
|
module.exports.sleep = async (ms, fn) => {
|
||
|
await timeout(ms);
|
||
|
return await fn(...args);
|
||
|
}
|