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

Function formatTimeCommand

scripts/benchmark/helpers/memory.ts:43–51  ·  view source on GitHub ↗
(
  command: string,
  memFile: string,
  wrapInShell: boolean,
)

Source from the content-addressed store, hash-verified

41
42// The pure wrapping (no availability check), split out for testing.
43export function formatTimeCommand(
44 command: string,
45 memFile: string,
46 wrapInShell: boolean,
47): string {
48 const inner = wrapInShell ? `sh -c ${shellQuote(command)}` : command;
49
50 return `${GNU_TIME} -o ${shellQuote(memFile)} -f %M ${inner}`;
51}
52
53/**
54 * Read the peak RSS (rounded to MB) that {@link wrapWithTime} wrote to

Callers 2

memory.test.tsFile · 0.90
wrapWithTimeFunction · 0.85

Calls 1

shellQuoteFunction · 0.70

Tested by

no test coverage detected