MCPcopy Index your code
hub / github.com/ChartGPU/ChartGPU / formatDuration

Function formatDuration

examples/worker-rendering/main.ts:190–196  ·  view source on GitHub ↗
(ms: number)

Source from the content-addressed store, hash-verified

188}
189
190function formatDuration(ms: number): string {
191 if (ms < 1000) return `${ms.toFixed(0)}ms`;
192 if (ms < 60000) return `${(ms / 1000).toFixed(1)}s`;
193 const minutes = Math.floor(ms / 60000);
194 const seconds = Math.floor((ms % 60000) / 1000);
195 return `${minutes}m ${seconds}s`;
196}
197
198function formatAbbreviatedNumber(n: number): string {
199 if (n < 1000) return n.toString();

Callers 2

updateMetricsDisplayFunction · 0.85
handleGenerateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected