(results: BenchResult[])
| 112 | } |
| 113 | |
| 114 | function printBenchTable(results: BenchResult[]) { |
| 115 | const nameW = Math.max(25, ...results.map((r) => r.name.length)); |
| 116 | console.log( |
| 117 | ` ${'Operation'.padEnd(nameW)} ${'BigDecimal'.padStart(10)} ${'Decimal.js'.padStart(10)} ${'Speedup'.padStart(15)}` |
| 118 | ); |
| 119 | console.log(` ${'─'.repeat(nameW)} ${'─'.repeat(10)} ${'─'.repeat(10)} ${'─'.repeat(15)}`); |
| 120 | for (const r of results) { |
| 121 | console.log( |
| 122 | ` ${r.name.padEnd(nameW)} ${formatMs(r.bdMs).padStart(10)} ${formatMs(r.djMs).padStart(10)} ${formatSpeedup(r.speedup).padStart(15 + 9)}` |
| 123 | ); |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | function printAccuracyTable(results: AccuracyResult[]) { |
| 128 | console.log( |
no test coverage detected