aboutsummaryrefslogtreecommitdiff
path: root/benchmark/os/cpus.js
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark/os/cpus.js')
-rw-r--r--benchmark/os/cpus.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/benchmark/os/cpus.js b/benchmark/os/cpus.js
new file mode 100644
index 0000000000..2a8535113c
--- /dev/null
+++ b/benchmark/os/cpus.js
@@ -0,0 +1,17 @@
+'use strict';
+
+const common = require('../common.js');
+const cpus = require('os').cpus;
+
+const bench = common.createBenchmark(main, {
+ n: [3e4]
+});
+
+function main(conf) {
+ const n = +conf.n;
+
+ bench.start();
+ for (var i = 0; i < n; ++i)
+ cpus();
+ bench.end(n);
+}