MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / fmtTime

Function fmtTime

scripts/agent-eval/parse-bench-readme.mjs:72–72  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

70
71const median = (arr) => { const v = [...arr].sort((a, b) => a - b); const n = v.length; return n === 0 ? 0 : n % 2 ? v[(n - 1) / 2] : (v[n / 2 - 1] + v[n / 2]) / 2; };
72const fmtTime = (s) => s >= 60 ? `${Math.floor(s / 60)}m ${Math.round(s % 60)}s` : `${Math.round(s)}s`;
73const fmtTok = (t) => t >= 1e6 ? `${(t / 1e6).toFixed(1)}M` : `${Math.round(t / 1000)}k`;
74const pct = (w, wo) => wo > 0 ? Math.round((1 - w / wo) * 100) : 0;
75

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected