PerformanceObserver Class

Observes the entries added to the performance timeline of a global object (https://w3c.github.io/performance-timeline/#the-performanceobserver-interface).

public sealed class PerformanceObserver

Constructors

NameDescription
PerformanceObserver(GlobalScope, PerformanceObserverCallback)Creates an observer of the performance timeline of a global object.
PerformanceObserver(PerformanceObserverCallback)Creates an observer of the performance timeline of the current global object.

PerformanceObserver overloads

PerformanceObserver(GlobalScope, PerformanceObserverCallback)

PerformanceObserver.cs

Creates an observer of the performance timeline of a global object.

public PerformanceObserver(GlobalScope global, PerformanceObserverCallback callback)
Parameters
global GlobalScope
The global object whose performance timeline is observed.
callback PerformanceObserverCallback
The callback invoked with the observed entries.

PerformanceObserver(PerformanceObserverCallback)

PerformanceObserver.cs

Creates an observer of the performance timeline of the current global object.

public PerformanceObserver(PerformanceObserverCallback callback)
Parameters
callback PerformanceObserverCallback
The callback invoked with the observed entries.
See also

Properties

NameDescription
SupportedEntryTypesGets the entry types supported by the user agent, in alphabetical order (https://w3c.github.io/performance-timeline/#supportedentrytypes-attribute).

SupportedEntryTypes

PerformanceObserver.cs

Gets the entry types supported by the user agent, in alphabetical order (https://w3c.github.io/performance-timeline/#supportedentrytypes-attribute).

public static IReadOnlyList<string> SupportedEntryTypes { get; }

Methods

NameDescription
Disconnect()Stops observing the entries and discards the entries of the observer buffer (https://w3c.github.io/performance-timeline/#disconnect-method).
Observe(PerformanceObserverInit?)Starts to observe the entries of one or several types (https://w3c.github.io/performance-timeline/#observe-method).
TakeRecords()Returns the entries of the observer buffer and empties it (https://w3c.github.io/performance-timeline/#takerecords-method).

Stops observing the entries and discards the entries of the observer buffer (https://w3c.github.io/performance-timeline/#disconnect-method).

public void Disconnect()

Observe(PerformanceObserverInit?)

PerformanceObserver.cs

Starts to observe the entries of one or several types (https://w3c.github.io/performance-timeline/#observe-method).

public void Observe(PerformanceObserverInit? options = null)

Returns the entries of the observer buffer and empties it (https://w3c.github.io/performance-timeline/#takerecords-method).

public IReadOnlyList<PerformanceEntry> TakeRecords()