Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark')
-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 00000000000..2a8535113c2
--- /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);
+}