(ms)
| 464 | // Combined quality + speed tables per category. Each cell shows the verdict |
| 465 | // and the median per-call time, so a table is informative even when every tool |
| 466 | // is correct (the times still differ). |
| 467 | // Format a per-call time (ms). At/above 0.01ms the historical bands apply |
| 468 | // (2dp <10, 1dp <100, integer otherwise). Below 0.01ms — the fast numeric / |
| 469 | // differentiation ops — fixed 2dp would collapse everything to "0.00", hiding a |
| 470 | // real 5–200× spread, so show 2 significant figures instead (e.g. 0.00079 vs |
| 471 | // 0.0033 vs 0.16). Sub-microsecond constants are genuinely this fast warm. |
| 472 | const fmtT = (ms) => { |
| 473 | if (ms == null) return null; |
| 474 | if (ms >= 0.01) return ms < 10 ? ms.toFixed(2) : ms < 100 ? ms.toFixed(1) : String(Math.round(ms)); |
| 475 | if (!(ms > 0)) return '0'; |
| 476 | let s = ms.toPrecision(2); // 2 sig figs |
no test coverage detected