console-feed icon indicating copy to clipboard operation
console-feed copied to clipboard

console.time() / timeEnd() gives inaccurate results

Open lbogdan opened this issue 3 years ago • 0 comments

Consider this code:

console.time("merge");
for (let i = 0; i < 100000; i++) {
  merge(obj, a);
  shallowEqual(a, b);
}
console.timeEnd("merge");

Expected output (from Chrome's console):

image

Actual output:

image

Reproduction sandbox: https://codesandbox.io/s/console-feed-time-timeend-n2v9n (be warned it can be a bit taxing on the CPU)

Related CodeSandbox issue: https://github.com/codesandbox/codesandbox-client/issues/5077

lbogdan avatar May 27 '21 10:05 lbogdan