uni-ticket-system/node_modules/licia/ric.js

23 lines
526 B
JavaScript
Raw Normal View History

2023-12-05 02:11:10 +00:00
var root = require('./root');
var now = require('./now');
exports =
root.requestIdleCallback ||
function(cb) {
var start = now();
return setTimeout(function() {
cb({
didTimeout: false,
timeRemaining: function() {
return Math.max(0, 50 - (now() - start));
}
});
}, 1);
};
exports.cancel =
root.cancelIdleCallback ||
function(id) {
clearTimeout(id);
};
module.exports = exports;