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 PerformanceObserverConstructors
| Name | Description |
|---|---|
| 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.csCreates an observer of the performance timeline of a global object.
public PerformanceObserver(GlobalScope global, PerformanceObserverCallback callback)Parameters
globalGlobalScope- The global object whose performance timeline is observed.
callbackPerformanceObserverCallback- The callback invoked with the observed entries.
PerformanceObserver(PerformanceObserverCallback)
PerformanceObserver.csCreates an observer of the performance timeline of the current global object.
public PerformanceObserver(PerformanceObserverCallback callback)Parameters
callbackPerformanceObserverCallback- The callback invoked with the observed entries.
See also
Properties
| Name | Description |
|---|---|
| SupportedEntryTypes | Gets the entry types supported by the user agent, in alphabetical order (https://w3c.github.io/performance-timeline/#supportedentrytypes-attribute). |
SupportedEntryTypes
PerformanceObserver.csGets 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
| Name | Description |
|---|---|
| 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). |
Disconnect()
PerformanceObserver.csStops 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.csStarts to observe the entries of one or several types (https://w3c.github.io/performance-timeline/#observe-method).
public void Observe(PerformanceObserverInit? options = null)TakeRecords()
PerformanceObserver.csReturns the entries of the observer buffer and empties it (https://w3c.github.io/performance-timeline/#takerecords-method).
public IReadOnlyList<PerformanceEntry> TakeRecords()