mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
377 B
21 lines
377 B
9 years ago
|
'use strict';
|
||
12 years ago
|
var common = require('../common.js');
|
||
|
var bench = common.createBenchmark(main, {
|
||
|
millions: [2]
|
||
|
});
|
||
13 years ago
|
|
||
12 years ago
|
process.maxTickDepth = Infinity;
|
||
13 years ago
|
|
||
12 years ago
|
function main(conf) {
|
||
|
var n = +conf.millions * 1e6;
|
||
13 years ago
|
|
||
12 years ago
|
bench.start();
|
||
|
process.nextTick(onNextTick);
|
||
|
function onNextTick() {
|
||
|
if (--n)
|
||
|
process.nextTick(onNextTick);
|
||
|
else
|
||
|
bench.end(+conf.millions);
|
||
|
}
|
||
|
}
|