(task, name)
| 722 | * @returns {[number, number] | undefined} start and end time |
| 723 | */ |
| 724 | const iteration = (task, name) => { |
| 725 | const { fn, options } = |
| 726 | /** @type {TaskMeta} */ |
| 727 | (uriMap.get(name)); |
| 728 | |
| 729 | try { |
| 730 | options?.beforeEach?.call(task, "run"); |
| 731 | const start = bench.now(); |
| 732 | fn(); |
| 733 | const end = bench.now() - start || 0; |
| 734 | options?.afterEach?.call(task, "run"); |
| 735 | return [start, end]; |
| 736 | } catch (err) { |
| 737 | if (bench.throws) { |
| 738 | throw err; |
| 739 | } |
| 740 | } |
| 741 | }; |
| 742 | |
| 743 | /** |
| 744 | * @param {Fn} fn function |
no test coverage detected