turbo-sync/utils/delay.js

17 lines
244 B
JavaScript

// @ts-check
/**
*
* @param {number} [time]
* @returns
*/
async function delay(time) {
return new Promise((resolve) => {
setTimeout(() => {
resolve(true);
}, time || 500);
});
}
module.exports = delay;