MCPcopy Create free account
hub / github.com/botbotrobotics/BotBrain / formatLatency

Function formatLatency

frontend/src/utils/format-utils.tsx:23–27  ·  view source on GitHub ↗
(ms: number)

Source from the content-addressed store, hash-verified

21 * @returns Formatted string with appropriate units (ms or s)
22 */
23export function formatLatency(ms: number): string {
24 if (ms < 0) return 'N/A';
25 if (ms < 1000) return `${Math.round(ms)} ms`;
26 return `${(ms / 1000).toFixed(2)} s`;
27}
28
29/**
30 * Format data rate to human-readable format

Callers 3

LatencyIndicatorFunction · 0.90
LatencyIndicatorDetailedFunction · 0.90
HealthPageFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected