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

Function formatDuration

src/bin/codegraph.ts:306–317  ·  view source on GitHub ↗

* Format duration in milliseconds to human readable

(ms: number)

Source from the content-addressed store, hash-verified

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