Skip to content

Commit

Permalink
benchmark: allow easy passing of process flags
Browse files Browse the repository at this point in the history
  • Loading branch information
mscdex committed Aug 7, 2019
1 parent aa252eb commit c0358a8
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 c0358a8

Please sign in to comment.