(ms: number)
| 21 | * @returns Formatted string with appropriate units (ms or s) |
| 22 | */ |
| 23 | export 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 |
no outgoing calls
no test coverage detected