MCPcopy Index your code
hub / github.com/angular/angular / reportProfileResults

Function reportProfileResults

modules/benchmarks/src/util.ts:60–71  ·  view source on GitHub ↗
(durations: number[], count: number)

Source from the content-addressed store, hash-verified

58}
59
60function reportProfileResults(durations: number[], count: number) {
61 const totalDuration = durations.reduce((soFar: number, duration: number) => soFar + duration, 0);
62 const avgDuration = (totalDuration / count).toFixed(2);
63 const minDuration = durations
64 .reduce((soFar: number, duration: number) => Math.min(soFar, duration), Number.MAX_SAFE_INTEGER)
65 .toFixed(2);
66 window.console.log(
67 `Iterations: ${count}; cold time: ${durations[0].toFixed(
68 2,
69 )} ms; average time: ${avgDuration} ms / iteration; best time: ${minDuration} ms`,
70 );
71}
72
73// helper script that will read out the url parameters
74// and store them in appropriate form fields on the page

Callers 1

profileFunction · 0.85

Calls 3

reduceMethod · 0.80
logMethod · 0.65
minMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…