From 5008b461594f6beb922bef849947b3a36ed52069 Mon Sep 17 00:00:00 2001 From: Brian White Date: Mon, 5 Aug 2019 19:51:18 -0400 Subject: [PATCH] benchmark: allow easy passing of process flags PR-URL: https://github.com/nodejs/node/pull/28986 Reviewed-By: Ben Noordhuis Reviewed-By: James M Snell Reviewed-By: Rich Trott Reviewed-By: Anatoli Papirovski Reviewed-By: Trivikram Kamat --- benchmark/common.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/benchmark/common.js b/benchmark/common.js index b4778d71935e25..6a3be4fc376920 100644 --- a/benchmark/common.js +++ b/benchmark/common.js @@ -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