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

Function timed

examples/wasm-simple/example.js:21–28  ·  examples/wasm-simple/example.js::timed
(name, fn)

Source from the content-addressed store, hash-verified

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

Callers 1

example.jsFile · 0.70

Calls 3

timeMethod · 0.80
timeEndMethod · 0.80
fnFunction · 0.50

Tested by

no test coverage detected