MCPcopy Create free account
hub / github.com/TanStack/ai / formatDuration

Function formatDuration

examples/ts-code-mode-web/src/lib/efficiency.ts:227–231  ·  view source on GitHub ↗
(ms: number)

Source from the content-addressed store, hash-verified

225}
226
227export function formatDuration(ms: number): string {
228 if (ms < 1000) return `${ms}ms`
229 if (ms < 60000) return `${Math.round(ms / 1000)}s`
230 return `${Math.round(ms / 60000)}m ${Math.round((ms % 60000) / 1000)}s`
231}
232
233export function formatCurrency(amount: number): string {
234 if (amount < 0.01) return '<$0.01'

Callers 3

ContextSavingsFunction · 0.90
NoCodeMetricsFunction · 0.90
MetricsSidebarFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected