( name: string, actions: (n: number) => void, maxResult: number, before?: () => void, )
| 69 | }; |
| 70 | |
| 71 | export const repeatRows = ( |
| 72 | name: string, |
| 73 | actions: (n: number) => void, |
| 74 | maxResult: number, |
| 75 | before?: () => void, |
| 76 | ): void => { |
| 77 | repeat( |
| 78 | name, |
| 79 | 'row count', |
| 80 | 'µs per row', |
| 81 | (N, stepSize) => [ |
| 82 | µs(() => { |
| 83 | for (let n = N - stepSize; n <= N; n++) { |
| 84 | actions(n); |
| 85 | } |
| 86 | }), |
| 87 | stepSize, |
| 88 | ], |
| 89 | maxResult, |
| 90 | before, |
| 91 | ); |
| 92 | }; |
| 93 | |
| 94 | export const µs = (actions: () => void): number => { |
| 95 | const start = performance.now(); |
no test coverage detected
searching dependent graphs…