PerformanceObserver
Nieoficjalne Tłumaczenie Beta
Ta strona została przetłumaczona przez PageTurner AI (beta). Nie jest oficjalnie zatwierdzona przez projekt. Znalazłeś błąd? Zgłoś problem →
Globalna klasa PerformanceObserver, zgodnie ze specyfikacjami sieciowymi.
Przykład
ts
const observer = new PerformanceObserver(
(list, observer, options) => {
for (const entry of list.getEntries()) {
console.log(
'Received entry with type',
entry.entryType,
'and name',
entry.name,
'that started at',
entry.startTime,
'and took',
entry.duration,
'ms',
);
}
},
);
observer.observe({entryTypes: ['mark', 'measure']});
Dokumentacja
Konstruktor
PerformanceObserver()
Zobacz dokumentację w MDN.
Właściwości statyczne
supportedEntryTypes
Zobacz dokumentację w MDN.
Zwraca ['mark', 'measure', 'event', 'longtask'].
Metody instancji
observe()
Zobacz dokumentację w MDN.
disconnect()
Zobacz dokumentację w MDN.