(timings: SerializedTimings)
| 3 | import { bold, underline } from '../../src/utils/colors'; |
| 4 | |
| 5 | export function printTimings(timings: SerializedTimings): void { |
| 6 | for (const [label, [time, memory, total]] of Object.entries(timings)) { |
| 7 | const appliedColor = |
| 8 | label[0] === '#' ? (label[1] === '#' ? bold : underline) : (text: string) => text; |
| 9 | const row = `${label}: ${time.toFixed(0)}ms, ${prettyBytes(memory)} / ${prettyBytes(total)}`; |
| 10 | console.info(appliedColor(row)); |
| 11 | } |
| 12 | } |