Class PerformanceObserver
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
The PerformanceObserver interface is used to observe performance measurement events and be notified of new PerformanceEntry as they are recorded in the browser's performance timeline.
[Value("PerformanceObserver")]
public class PerformanceObserver
- Inheritance
-
PerformanceObserver
- Inherited Members
Remarks
-'MutationObserver'
-'ResizeObserver'
-'IntersectionObserver'
Constructors
PerformanceObserver()
public PerformanceObserver()
PerformanceObserver(PerformanceObserverCallback)
The PerformanceObserver() constructor creates a new PerformanceObserver object with the given observer callback. The observer callback is invoked when PerformanceEntry are recorded for the EntryType that have been registered, via the Observe(PerformanceObserverInit) method.
public PerformanceObserver(PerformanceObserverCallback callback)
Parameters
callbackPerformanceObserverCallback
Remarks
Properties
SupportedEntryTypes
The static supportedEntryTypes read-only property of the PerformanceObserver interface returns an array of the EntryType values supported by the user agent.
[Value("supportedEntryTypes")]
public static string[] SupportedEntryTypes { get; }
Property Value
Remarks
As the list of supported entries varies per browser and is evolving, this property allows web developers to check which are available.
Methods
Disconnect()
The disconnect() method of the 'PerformanceObserver' interface is used to stop the performance observer from receiving any PerformanceEntry events.
[Value("disconnect")]
public GlobalObject.Undefined Disconnect()
Returns
Remarks
Observe(PerformanceObserverInit)
The observe() method of the PerformanceObserver interface is used to specify the set of performance entry types to observe.
[Value("observe")]
public GlobalObject.Undefined Observe(PerformanceObserverInit options = null)
Parameters
optionsPerformanceObserverInit
Returns
Remarks
See EntryType for a list of entry types and SupportedEntryTypes for a list of entry types the user agent supports.
When a matching performance entry is recorded, the performance observer's callback function—set when creating the PerformanceObserver—is invoked.
TakeRecords()
The takeRecords() method of the 'PerformanceObserver' interface returns the current list of PerformanceEntry objects stored in the performance observer, emptying it out.
[Value("takeRecords")]
public List<PerformanceEntry> TakeRecords()
Returns
- List<PerformanceEntry>
A list of PerformanceEntry objects.