* @param {number} value time * @returns {string} formatted time
(value)
| 1332 | * @returns {string} formatted time |
| 1333 | */ |
| 1334 | function formatTime(value) { |
| 1335 | const toType = |
| 1336 | Math.round(value) > 0 |
| 1337 | ? "ms" |
| 1338 | : Math.round(value * US_PER_MS) / US_PER_MS > 0 |
| 1339 | ? "µs" |
| 1340 | : "ns"; |
| 1341 | |
| 1342 | switch (toType) { |
| 1343 | case "ms": { |
| 1344 | return `${formatNumber(value, 5, 2)} ms`; |
| 1345 | } |
| 1346 | case "µs": { |
| 1347 | return `${formatNumber(value * US_PER_MS, 5, 2)} µs`; |
| 1348 | } |
| 1349 | case "ns": { |
| 1350 | return `${formatNumber(value * NS_PER_MS, 5, 2)} ns`; |
| 1351 | } |
| 1352 | } |
| 1353 | } |
| 1354 | |
| 1355 | const statsByTests = new Map(); |
| 1356 |
no test coverage detected