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

Function formatSpeedup

test/big-decimal/comprehensive-benchmark.ts:103–106  ·  view source on GitHub ↗
(s: number)

Source from the content-addressed store, hash-verified

101// ================================================================
102
103function formatSpeedup(s: number): string {
104 if (s >= 1) return `\x1b[32m${s.toFixed(1)}x faster\x1b[0m`;
105 return `\x1b[31m${(1 / s).toFixed(1)}x slower\x1b[0m`;
106}
107
108function formatMs(ms: number): string {
109 if (ms < 0.001) return `${(ms * 1000).toFixed(1)}µs`;

Callers 1

printBenchTableFunction · 0.85

Calls 1

toFixedMethod · 0.80

Tested by

no test coverage detected