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

Function wrapWithTime

scripts/benchmark/helpers/gnu-time.ts:48–56  ·  view source on GitHub ↗
(
  command: string,
  outFile: string,
  wrapInShell: boolean,
)

Source from the content-addressed store, hash-verified

46 * needs no inner shell.
47 */
48export function wrapWithTime(
49 command: string,
50 outFile: string,
51 wrapInShell: boolean,
52): string {
53 const inner = wrapInShell ? `sh -c ${shellQuote(command)}` : command;
54
55 return `${GNU_TIME} -o ${shellQuote(outFile)} -f '%U %S %M' ${inner}`;
56}
57
58/**
59 * Read the measurement line that {@link wrapWithTime} wrote to `outFile`:

Callers 3

runStepsPhaseFunction · 0.90
runBenchmarkFunction · 0.90
gnu-time.test.tsFile · 0.90

Calls 1

shellQuoteFunction · 0.70

Tested by

no test coverage detected