Skip to content

Commit 7e5cd08

Browse files
committed
bench: move next-tick to misc/next-tick-breadth
1 parent f7a4ccb commit 7e5cd08

2 files changed

Lines changed: 21 additions & 17 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
var common = require('../common.js');
3+
var bench = common.createBenchmark(main, {
4+
millions: [2]
5+
});
6+
7+
function main(conf) {
8+
var N = +conf.millions * 1e6;
9+
var n = 0;
10+
11+
function cb() {
12+
n++;
13+
if (n === N)
14+
bench.end(n / 1e6);
15+
}
16+
17+
bench.start();
18+
for (var i = 0; i < N; i++) {
19+
process.nextTick(cb);
20+
}
21+
}

benchmark/next-tick.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)