Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions benchmark/timers/timers-breadth.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
'use strict';
var common = require('../common.js');

var bench = common.createBenchmark(main, {
thousands: [500],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: trailing comma.

});

function main(conf) {
var N = +conf.thousands * 1e3;
var n = 0;
bench.start();
function cb() {
n++;
if (n === N)
bench.end(N / 1e3);
}
for (var i = 0; i < N; i++) {
setTimeout(cb, 1);
}
}
20 changes: 20 additions & 0 deletions benchmark/timers/timers-depth.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
'use strict';
var common = require('../common.js');

var bench = common.createBenchmark(main, {
thousands: [1],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

});

function main(conf) {
var N = +conf.thousands * 1e3;
var n = 0;
bench.start();
setTimeout(cb, 1);
function cb() {
n++;
if (n === N)
bench.end(N / 1e3);
else
setTimeout(cb, 1);
}
}
41 changes: 0 additions & 41 deletions benchmark/timers/timers.js

This file was deleted.