(durationMs: number)
| 1 | export 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 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…