MCPcopy Index your code
hub / github.com/developit/optimize-plugin / createPerformanceTimings

Function createPerformanceTimings

src/lib/util.js:70–92  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

68}
69
70export function createPerformanceTimings () {
71 const timings = [];
72
73 const start = name => {
74 timings.push({ name, start: Date.now() });
75 };
76
77 const end = name => {
78 for (const entry of timings) {
79 if (entry.name === name) {
80 entry.end = Date.now();
81 entry.duration = entry.end - entry.start;
82 return;
83 }
84 }
85 };
86
87 return {
88 timings,
89 start,
90 end
91 };
92}

Callers 2

optimizeMethod · 0.90
processFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected