(name: string, fn: () => void, iterations: number = 1)
| 3 | const ce = new ComputeEngine(); |
| 4 | |
| 5 | function benchmark(name: string, fn: () => void, iterations: number = 1) { |
| 6 | const start = performance.now(); |
| 7 | for (let i = 0; i < iterations; i++) { |
| 8 | fn(); |
| 9 | } |
| 10 | const end = performance.now(); |
| 11 | console.log(`${name}: ${((end - start) / iterations).toFixed(2)}ms`); |
| 12 | } |
| 13 | |
| 14 | console.log('--- Numerical Evaluation Benchmarks ---'); |
| 15 |
no test coverage detected