(func: Function)
| 302 | } |
| 303 | |
| 304 | function executeTest(func: Function): string { |
| 305 | let total = 0; |
| 306 | for (let i = 0; i < average; i++) { |
| 307 | const start = time(); |
| 308 | func(); |
| 309 | const end = time(); |
| 310 | const duration = end - start; |
| 311 | total += duration; |
| 312 | } |
| 313 | |
| 314 | const avg = total / average; |
| 315 | const res = `${avg.toFixed(2)}`; |
| 316 | |
| 317 | return res; |
| 318 | } |
| 319 | |
| 320 | function setResultTime(time: string) { |
| 321 | return `\t${time}`; |
no test coverage detected