Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
bench: add process.nextTick() benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoordhuis committed Oct 31, 2011
1 parent f53d092 commit 5fee1ff
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions 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);
}

0 comments on commit 5fee1ff

Please sign in to comment.