You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To determine when long tasks happen, you can use [PerformanceObserver](https://developer.mozilla.org/docs/Web/API/PerformanceObserver) and register to observe entries of type `longtask`:
363
+
364
+
```js
365
+
try {
366
+
// Create the performance observer.
367
+
constpo=newPerformanceObserver((list) => {
368
+
for (constentryoflist.getEntries()) {
369
+
// Log the entry and all associated details.
370
+
console.table(entry.toJSON());
371
+
}
372
+
});
373
+
// Start listening for `longtask` entries to be dispatched.
374
+
po.observe({type:'longtask', buffered:true});
375
+
} catch (e) {
376
+
console.log(`The browser doesn't support this API`)
0 commit comments