MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / formatMs

Function formatMs

test/big-decimal/comprehensive-benchmark.ts:108–112  ·  view source on GitHub ↗
(ms: number)

Source from the content-addressed store, hash-verified

106}
107
108function formatMs(ms: number): string {
109 if (ms < 0.001) return `${(ms * 1000).toFixed(1)}µs`;
110 if (ms < 1) return `${ms.toFixed(4)}ms`;
111 return `${ms.toFixed(1)}ms`;
112}
113
114function printBenchTable(results: BenchResult[]) {
115 const nameW = Math.max(25, ...results.map((r) => r.name.length));

Callers 1

printBenchTableFunction · 0.85

Calls 1

toFixedMethod · 0.80

Tested by

no test coverage detected