Browse Source

bench: add process.nextTick() benchmark

v0.7.4-release
Ben Noordhuis 13 years ago
parent
commit
5fee1ff7bc
  1. 17
      benchmark/next-tick.js

17
benchmark/next-tick.js

@ -0,0 +1,17 @@
// run with `time node benchmark/next-tick.js`
var assert = require('assert');
var N = 1e7;
var n = 0;
process.on('exit', function() {
assert.equal(n, N);
});
function cb() {
n++;
}
for (var i = 0; i < N; ++i) {
process.nextTick(cb);
}
Loading…
Cancel
Save