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

Function formatDuration

src/bin/codegraph.ts:305–316  ·  view source on GitHub ↗

* Format duration in milliseconds to human readable

(ms: number)

Source from the content-addressed store, hash-verified

303 * Format duration in milliseconds to human readable
304 */
305function formatDuration(ms: number): string {
306 if (ms < 1000) {
307 return `${ms}ms`;
308 }
309 const seconds = ms / 1000;
310 if (seconds < 60) {
311 return `${seconds.toFixed(1)}s`;
312 }
313 const minutes = Math.floor(seconds / 60);
314 const remainingSeconds = seconds % 60;
315 return `${minutes}m ${remainingSeconds.toFixed(0)}s`;
316}
317
318// Shimmer progress renderer (runs in a worker thread for smooth animation)
319// Imported at top of file from '../ui/shimmer-progress'

Callers 2

printIndexResultFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected