MCPcopy Create free account
hub / github.com/NomicFoundation/hardhat / buildHyperfineCommand

Function buildHyperfineCommand

scripts/benchmark/main.ts:160–196  ·  view source on GitHub ↗
(
  command: string,
  warmup: number,
  runs: number,
  prepare: string | undefined,
  ignoreFailure: boolean,
  showOutput: boolean,
  exportJson: string | undefined,
)

Source from the content-addressed store, hash-verified

158}
159
160function buildHyperfineCommand(
161 command: string,
162 warmup: number,
163 runs: number,
164 prepare: string | undefined,
165 ignoreFailure: boolean,
166 showOutput: boolean,
167 exportJson: string | undefined,
168): string {
169 const parts: string[] = ["hyperfine"];
170
171 if (warmup > 0) {
172 parts.push("--warmup", String(warmup));
173 }
174
175 parts.push("--runs", String(runs));
176
177 if (prepare !== undefined) {
178 parts.push("--prepare", `'${prepare}'`);
179 }
180
181 if (ignoreFailure) {
182 parts.push("--ignore-failure");
183 }
184
185 if (showOutput) {
186 parts.push("--show-output");
187 }
188
189 if (exportJson !== undefined) {
190 parts.push("--export-json", `'${exportJson}'`);
191 }
192
193 parts.push(`'${command}'`);
194
195 return parts.join(" ");
196}
197
198if (import.meta.main) {
199 await cliMain();

Callers 1

runBenchmarkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected