summaryrefslogtreecommitdiff
path: root/benchmark/assert/ok.js
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark/assert/ok.js')
-rw-r--r--benchmark/assert/ok.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/benchmark/assert/ok.js b/benchmark/assert/ok.js
new file mode 100644
index 0000000000..849be65539
--- /dev/null
+++ b/benchmark/assert/ok.js
@@ -0,0 +1,20 @@
+'use strict';
+
+const common = require('../common.js');
+const assert = require('assert');
+
+const bench = common.createBenchmark(main, {
+ n: [1e9]
+});
+
+function main({ n }) {
+ var i;
+ bench.start();
+ for (i = 0; i < n; ++i) {
+ if (i % 2 === 0)
+ assert(true);
+ else
+ assert(true, 'foo bar baz');
+ }
+ bench.end(n);
+}