MCPcopy Create free account
hub / github.com/ampproject/amphtml / measureLongTasks

Function measureLongTasks

testing/amp-performance-extension/measure.js:50–60  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48}
49
50function measureLongTasks() {
51 const supported = PerformanceObserver.supportedEntryTypes;
52 if (!supported || supported.indexOf('longtask') === -1) {
53 return;
54 }
55 longTasks = [];
56 const longTaskObserver = new PerformanceObserver((list) =>
57 list.getEntries().forEach((entry) => longTasks.push(entry))
58 );
59 longTaskObserver.observe({entryTypes: ['longtask']});
60}
61
62function measureTimeToInteractive() {
63 measureStarted = Date.now();

Callers 1

measure.jsFile · 0.85

Calls 3

forEachMethod · 0.45
pushMethod · 0.45
observeMethod · 0.45

Tested by

no test coverage detected