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

Function formatDuration

src/bin/codegraph.ts:307–318  ·  view source on GitHub ↗

* Format duration in milliseconds to human readable

(ms: number)

Source from the content-addressed store, hash-verified

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