MCPcopy Create free account
hub / github.com/base/base / duration

Function duration

etc/scripts/ci/render_fresh_devnet_bench.py:33–43  ·  view source on GitHub ↗
(value: object)

Source from the content-addressed store, hash-verified

31
32
33def duration(value: object) -> str:
34 if not isinstance(value, dict):
35 return "—"
36 seconds = value.get("secs")
37 nanoseconds = value.get("nanos")
38 if not isinstance(seconds, int) or not isinstance(nanoseconds, int):
39 return "—"
40 milliseconds = seconds * 1_000 + nanoseconds / 1_000_000
41 if milliseconds < 1:
42 return f"{milliseconds * 1_000:.0f} µs"
43 return f"{milliseconds:.1f} ms"
44
45
46def summary_values(results_dir: Path, output_dir: str) -> tuple[str, str, str, str]:

Callers 2

summary_valuesFunction · 0.85
etaMethod · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected