MCPcopy
hub / github.com/colbymchenry/codegraph / formatDuration

Function formatDuration

src/bin/codegraph.ts:237–248  ·  view source on GitHub ↗

* Format duration in milliseconds to human readable

(ms: number)

Source from the content-addressed store, hash-verified

235 * Format duration in milliseconds to human readable
236 */
237function formatDuration(ms: number): string {
238 if (ms < 1000) {
239 return `${ms}ms`;
240 }
241 const seconds = ms / 1000;
242 if (seconds < 60) {
243 return `${seconds.toFixed(1)}s`;
244 }
245 const minutes = Math.floor(seconds / 60);
246 const remainingSeconds = seconds % 60;
247 return `${minutes}m ${remainingSeconds.toFixed(0)}s`;
248}
249
250// Shimmer progress renderer (runs in a worker thread for smooth animation)
251// 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