MCPcopy
hub / github.com/webpack/webpack / wrapWithInstrumentHooksAsync

Function wrapWithInstrumentHooksAsync

test/BenchmarkTestCases.benchmark.mjs:634–640  ·  view source on GitHub ↗
(fn, uri)

Source from the content-addressed store, hash-verified

632 * @returns {Promise<ReturnType<Fn>>} result with instrument hooks
633 */
634 const wrapWithInstrumentHooksAsync = async (fn, uri) => {
635 InstrumentHooks.startBenchmark();
636 const result = await fn();
637 InstrumentHooks.stopBenchmark();
638 InstrumentHooks.setExecutedBenchmark(process.pid, uri);
639 return result;
640 };
641
642 /**
643 * @param {Task} task task

Callers 1

runTaskAsyncFunction · 0.85

Calls 1

fnFunction · 0.50

Tested by

no test coverage detected