blob: b02315b10ca96f7de5f5906b2abbcbd37966407c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
'use strict';
require('../common');
module.exports = function tick(x, cb) {
function ontick() {
if (--x === 0) {
if (typeof cb === 'function') cb();
} else {
setImmediate(ontick);
}
}
setImmediate(ontick);
};
|