MCPcopy
hub / github.com/webpack/webpack / iteration

Function iteration

test/BenchmarkTestCases.benchmark.mjs:724–741  ·  view source on GitHub ↗
(task, name)

Source from the content-addressed store, hash-verified

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

Callers 2

runTaskSyncFunction · 0.85
primeTaskSyncFunction · 0.85

Calls 3

fnFunction · 0.50
getMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected