Skip to content

Commit 5008b46

Browse files
mscdextargos
authored andcommitted
benchmark: allow easy passing of process flags
PR-URL: #28986 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent f194626 commit 5008b46

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

benchmark/common.js

+4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ function Benchmark(fn, configs, options) {
2525
if (options && options.flags) {
2626
this.flags = this.flags.concat(options.flags);
2727
}
28+
if (process.env.NODE_BENCHMARK_FLAGS) {
29+
const flags = process.env.NODE_BENCHMARK_FLAGS.split(/\s+/);
30+
this.flags = this.flags.concat(flags);
31+
}
2832
// Holds process.hrtime value
2933
this._time = [0, 0];
3034
// Used to make sure a benchmark only start a timer once

0 commit comments

Comments
 (0)