Class PerformanceEntry
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
The PerformanceEntry object encapsulates a single performance metric that is part of the browser's performance timeline.
[Value("PerformanceEntry")]
public class PerformanceEntry
- Inheritance
-
PerformanceEntry
- Derived
- Inherited Members
Remarks
The Performance API offers built-in metrics which are specialized subclasses of PerformanceEntry. This includes entries for resource loading, event timing, and more.
A performance entry can also be created by calling the Mark(string, PerformanceMarkOptions) or Measure(string, Union158, string) methods at an explicit point in an application. This allows you to add your own metrics to the performance timeline.
The PerformanceEntry instances will always be one of the following subclasses:
Constructors
PerformanceEntry()
public PerformanceEntry()
Properties
Duration
The read-only duration property returns a {{domxref("DOMHighResTimeStamp","timestamp", "", "no-code")}} that is the duration of the {{domxref("PerformanceEntry","performance entry", "", "no-code")}}. The meaning of this property depends on the value of this entry's EntryType.
[Value("duration")]
public Number Duration { get; }
Property Value
- Number
A Number representing the duration of the {{domxref("PerformanceEntry","performance entry", "", "no-code")}}. If the duration concept doesn't apply for a particular performance metric, a duration of
0is returned.The meaning of this property depends on the value of this performance entry's EntryType:For the following entry types,durationis not applicable, and in this case the value is always0:
Remarks
EntryType
The read-only entryType property returns a string representing the type of performance metric that this entry represents.
[Value("entryType")]
public string EntryType { get; }
Property Value
- string
A string. The return value depends on the subtype of the
PerformanceEntryobject. Some subtypes have more than oneentryType.
Remarks
All supported entryTypes are available using the static property SupportedEntryTypes.
-SupportedEntryTypes
-GetEntriesByType(string)
-GetEntriesByType(string)
Id
[Value("id")]
public ulong Id { get; }
Property Value
Name
The read-only name property of the PerformanceEntry interface is a string representing the name for a performance entry. It acts as an identifier, but it does not have to be unique. The value depends on the subclass.
[Value("name")]
public string Name { get; }
Property Value
- string
A string. The value depends on the subclass of the
PerformanceEntryobject as shown by the table below.
Remarks
NavigationId
[Value("navigationId")]
public ulong NavigationId { get; }
Property Value
StartTime
The read-only startTime property returns the first {{domxref("DOMHighResTimeStamp","timestamp", "", "no-code")}} recorded for this PerformanceEntry. The meaning of this property depends on the value of this entry's EntryType.
[Value("startTime")]
public Number StartTime { get; }
Property Value
- Number
A Number representing the first timestamp when the
PerformanceEntry was created.The meaning of this property depends on the value of this performance entry's EntryType:
Remarks
Methods
ToJSON()
The toJSON() method is a {{Glossary("Serialization","serializer")}}; it returns a JSON representation of the PerformanceEntry object.
[Value("toJSON")]
public Object ToJSON()
Returns
- Object
A {{jsxref("JSON")}} object that is the serialization of the PerformanceEntry object.