Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

bench: correct time calculation in url.js

  • Loading branch information...
commit 2c97da82f5e23beb3f78258bb1340e63895e5125 1 parent 1bcf29e
@bnoordhuis bnoordhuis authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 benchmark/url.js
View
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)));
}
Please sign in to comment.
Something went wrong with that request. Please try again.