summaryrefslogtreecommitdiff
path: root/benchmark/process/bench-hrtime.js
diff options
context:
space:
mode:
authorAndreas Madsen <amwebdk@gmail.com>2016-01-29 21:40:04 +0100
committerRod Vagg <rod@vagg.org>2016-02-26 20:28:45 +1100
commitd9079ab8013ba2c2a4704a2cca6fe3fcc0a1ecdd (patch)
treeca1875d33a81d5679e96e9be4afce1d2083bc6ac /benchmark/process/bench-hrtime.js
parent1d7c37018f619ebd4c7d538a4b65461cc447728d (diff)
downloadandroid-node-v8-d9079ab8013ba2c2a4704a2cca6fe3fcc0a1ecdd.tar.gz
android-node-v8-d9079ab8013ba2c2a4704a2cca6fe3fcc0a1ecdd.tar.bz2
android-node-v8-d9079ab8013ba2c2a4704a2cca6fe3fcc0a1ecdd.zip
benchmark: move misc to categorized directories
PR-URL: https://github.com/nodejs/node/pull/5177 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org>
Diffstat (limited to 'benchmark/process/bench-hrtime.js')
-rw-r--r--benchmark/process/bench-hrtime.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/benchmark/process/bench-hrtime.js b/benchmark/process/bench-hrtime.js
new file mode 100644
index 0000000000..661dff43b0
--- /dev/null
+++ b/benchmark/process/bench-hrtime.js
@@ -0,0 +1,18 @@
+'use strict';
+
+const common = require('../common');
+
+const bench = common.createBenchmark(main, {
+ n: [1e6]
+});
+
+
+function main(conf) {
+ const n = conf.n >>> 0;
+
+ bench.start();
+ for (var i = 0; i < n; i++) {
+ process.hrtime();
+ }
+ bench.end(n);
+}