MCPcopy
hub / github.com/webpack/webpack / timed

Function timed

examples/wasm-simple-source-phase/example.js:23–30  ·  examples/wasm-simple-source-phase/example.js::timed
(name, fn)

Source from the content-addressed store, hash-verified

21timed(class="st">"js fibonacci", () => fibonacciJavascript(22));
22
23function timed(name, fn) {
24 if (!console.time || !console.timeEnd) return fn();
25 class="cm">// warmup
26 for (var i = 0; i < 10; i++) fn();
27 console.time(name);
28 for (var i = 0; i < 5000; i++) fn();
29 console.timeEnd(name);
30}

Callers 1

example.jsFile · 0.70

Calls 3

timeMethod · 0.80
timeEndMethod · 0.80
fnFunction · 0.50

Tested by

no test coverage detected