Skip to content

Commit

Permalink
benchmark: allow easy passing of process flags
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
mscdex authored and targos committed Aug 19, 2019
1 parent f194626 commit 5008b46
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions benchmark/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ function Benchmark(fn, configs, options) {
if (options && options.flags) {
this.flags = this.flags.concat(options.flags);
}
if (process.env.NODE_BENCHMARK_FLAGS) {
const flags = process.env.NODE_BENCHMARK_FLAGS.split(/\s+/);
this.flags = this.flags.concat(flags);
}
// Holds process.hrtime value
this._time = [0, 0];
// Used to make sure a benchmark only start a timer once
Expand Down

0 comments on commit 5008b46

Please sign in to comment.