MCPcopy Create free account
hub / github.com/arctic-cli/interface / formatDuration

Function formatDuration

packages/arctic/src/cli/cmd/stats.ts:692–705  ·  view source on GitHub ↗
(ms: number)

Source from the content-addressed store, hash-verified

690}
691
692function formatDuration(ms: number): string {
693 const seconds = Math.floor(ms / 1000)
694 const minutes = Math.floor(seconds / 60)
695 const hours = Math.floor(minutes / 60)
696
697 if (hours > 0) {
698 const remainingMinutes = minutes % 60
699 return `${hours}h ${remainingMinutes}m`
700 }
701 if (minutes > 0) {
702 return `${minutes}m`
703 }
704 return `${seconds}s`
705}
706
707function formatHourRange(hour: number): string {
708 const start = hour.toString().padStart(2, "0")

Callers 1

displayStatsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected