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

Function fmtUs

benchmarks/report_changelog.mjs:77–84  ·  view source on GitHub ↗
(ms)

Source from the content-addressed store, hash-verified

75// thousands with a comma — a single unit reads more honestly than ms, where the
76// fastest cells collapse to "0.00".
77function fmtUs(ms) {
78 if (ms == null) return NONE;
79 const us = ms * 1000;
80 if (us < 10) return us.toFixed(1);
81 return Math.round(us)
82 .toString()
83 .replace(/\B(?=(\d{3})+(?!\d))/g, ',');
84}
85
86// A speedup factor for the symbolic table (Mathematica time ÷ engine time).
87// Higher is better; Mathematica itself is 1×. Values < 1 (engine slower than

Callers 1

Calls 4

toFixedMethod · 0.80
replaceMethod · 0.65
toStringMethod · 0.65
roundMethod · 0.45

Tested by

no test coverage detected