mirror of
https://github.com/oven-sh/bun
synced 2026-02-18 23:01:58 +00:00
13 lines
218 B
JavaScript
13 lines
218 B
JavaScript
'use strict';
|
|
|
|
module.exports = function tick(x, cb) {
|
|
function ontick() {
|
|
if (--x === 0) {
|
|
if (typeof cb === 'function') cb();
|
|
} else {
|
|
setImmediate(ontick);
|
|
}
|
|
}
|
|
setImmediate(ontick);
|
|
};
|