Browse Source

bench: correct time calculation in url.js

v0.9.2-release
Ben Noordhuis 12 years ago
parent
commit
2c97da82f5
  1. 5
      benchmark/url.js

5
benchmark/url.js

@ -33,9 +33,8 @@ function benchmark(name, fun) {
timestamp = process.hrtime(timestamp);
var seconds = timestamp[0];
var millis = timestamp[1]; // actually nanoseconds
while (millis > 1000) millis /= 10;
var time = (seconds * 1000 + millis) / 1000;
var nanos = timestamp[1];
var time = seconds + nanos / 1e9;
process.stdout.write(util.format('%s sec\n', time.toFixed(3)));
}

Loading…
Cancel
Save