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 <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • 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.