Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
1
export
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
IterationCard
Function · 0.90
UserMessageGroupCard
Function · 0.90
Calls
no outgoing calls
Tested by
no test coverage detected