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

Function formatDuration

packages/ai-devtools/src/components/utils/format.ts:1–5  ·  view source on GitHub ↗
(ms?: number)

Source from the content-addressed store, hash-verified

1export const formatDuration = (ms?: number): string => {
2 if (!ms) return '-'
3 if (ms < 1000) return `${ms}ms`
4 return `${(ms / 1000).toFixed(2)}s`
5}

Callers 2

IterationCardFunction · 0.90
UserMessageGroupCardFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected