MCPcopy Index your code
hub / github.com/callstack/agent-device / formatDurationSeconds

Function formatDurationSeconds

src/utils/duration-format.ts:1–6  ·  view source on GitHub ↗
(durationMs: number)

Source from the content-addressed store, hash-verified

1export function formatDurationSeconds(durationMs: number): string {
2 const seconds = Math.max(0, durationMs) / 1000;
3 if (seconds >= 10) return `${seconds.toFixed(1)}s`;
4 if (seconds >= 1) return `${seconds.toFixed(2)}s`;
5 return `${seconds.toFixed(3).replace(/0+$/, '').replace(/\.$/, '')}s`;
6}

Callers 5

formatReplayStepDetailsFunction · 0.90
formatReplayDurationFunction · 0.90
renderFlakyTestSummaryFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…