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

Function formatDuration

src/bin/codegraph.ts:281–292  ·  view source on GitHub ↗

* Format duration in milliseconds to human readable

(ms: number)

Source from the content-addressed store, hash-verified

279 * Format duration in milliseconds to human readable
280 */
281function formatDuration(ms: number): string {
282 if (ms < 1000) {
283 return `${ms}ms`;
284 }
285 const seconds = ms / 1000;
286 if (seconds < 60) {
287 return `${seconds.toFixed(1)}s`;
288 }
289 const minutes = Math.floor(seconds / 60);
290 const remainingSeconds = seconds % 60;
291 return `${minutes}m ${remainingSeconds.toFixed(0)}s`;
292}
293
294// Shimmer progress renderer (runs in a worker thread for smooth animation)
295// 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