'use strict';

/**
 * 延迟一定毫秒
 */
const sleep = (ms = 0) => new Promise((resolve) => setTimeout(resolve, ms));
/**
 * https://developer.mozilla.org/zh-CN/docs/Web/API/Window/requestIdleCallback
 *
 */
const requestIdle = (timeout = 1000) => new Promise((resolve) => requestIdleCallback(resolve, { timeout }));
/**
 * 超时
 */
const timeout = (ms = 0) => new Promise((reject) => setTimeout(reject, ms));

exports.requestIdle = requestIdle;
exports.sleep = sleep;
exports.timeout = timeout;
//# sourceMappingURL=sleep.js.map
