MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / run_timed

Function run_timed

benchmarks/run_benchmarks.py:173–183  ·  view source on GitHub ↗
(
    cmd: list[str],
    cwd: str | None = None,
    env: dict[str, str] | None = None,
)

Source from the content-addressed store, hash-verified

171
172
173def run_timed(
174 cmd: list[str],
175 cwd: str | None = None,
176 env: dict[str, str] | None = None,
177) -> tuple[float, int, subprocess.CompletedProcess]:
178 before = ru_maxrss_bytes()
179 t0 = time.perf_counter()
180 cp = subprocess.run(cmd, cwd=cwd, env=env, capture_output=True, text=True)
181 dt = time.perf_counter() - t0
182 after = ru_maxrss_bytes()
183 return dt, max(0, after - before), cp
184
185
186class TraceDecayMcp:

Callers 1

benchmark_tracedecayFunction · 0.85

Calls 2

ru_maxrss_bytesFunction · 0.85
runMethod · 0.45

Tested by

no test coverage detected