MCPcopy Create free account
hub / github.com/arktypeio/arktype / formatSeconds

Function formatSeconds

ark/attest/cli/trace.ts:169–178  ·  view source on GitHub ↗
(totalSeconds: number)

Source from the content-addressed store, hash-verified

167
168// Helper to format duration in seconds to a human-readable string
169const formatSeconds = (totalSeconds: number): string => {
170 if (totalSeconds < 0) totalSeconds = 0
171 const hours = Math.floor(totalSeconds / 3600)
172 const minutes = Math.floor((totalSeconds % 3600) / 60)
173 const seconds = Math.floor(totalSeconds % 60)
174
175 if (hours > 0) return `about ${hours} hour(s)`
176 if (minutes > 0) return `about ${minutes} minute(s)`
177 return `${seconds}s`
178}
179
180const canRewriteStdoutLine = (): boolean =>
181 Boolean(

Callers 1

renderMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected