turbo-sync/utils/delay.js

17 lines
244 B
JavaScript
Raw Normal View History

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