PerformanceEntry
Baseline
Widely available
This feature is well established and works across many devices and browser versions. Itâs been available across browsers since 2017ë 9ì.
PerformanceEntry ê°ì²´ë performance timeline ìì ë¨ì¼ ì±ë¥ ìì¹ë¥¼ 캡ìí í©ëë¤. performance entryë ìì©íë¡ê·¸ë¨ì í¹ì ì§ì ìì performance *mark*ë *measure*를 ìì±í¨ì¼ë¡ì¨ (ì를 ë¤ë©´ mark()를 í¸ì¶íë ë°©ë²ì¼ë¡) ì§ì ì ì¼ë¡ ë§ë¤ì´ì§ ì ììµëë¤. ëë (ì´ë¯¸ì§ì ê°ì) 리ìì¤ë¥¼ ë¡ë©íë ë±ì ê°ì ì ì¸ ë°©ë²ì¼ë¡ ìì±ë기ë í©ëë¤.
PerformanceEntry ì¸ì¤í´ì¤ë íì ë¤ì ìë¸íì
ë¤ ì¤ íë를 ë°ë¦
ëë¤:
PerformanceMarkPerformanceMeasurePerformanceFrameTimingPerformanceNavigationTimingPerformanceResourceTimingPerformancePaintTiming
ì°¸ê³ : ì´ ê¸°ë¥ì Web Workerìì ì¬ì©í ì ììµëë¤.
Properties
PerformanceEntry.nameì½ê¸° ì ì©-
A value that further specifies the value returned by the
PerformanceEntry.entryTypeproperty. The value of both depends on the subtype. See property page for valid values. PerformanceEntry.entryTypeì½ê¸° ì ì©-
A
DOMStringrepresenting the type of performance metric such as, for example, "mark". See property page for valid values. PerformanceEntry.startTimeì½ê¸° ì ì©-
A
DOMHighResTimeStamprepresenting the starting time for the performance metric. PerformanceEntry.durationì½ê¸° ì ì©-
A
DOMHighResTimeStamprepresenting the time value of the duration of the performance event.
Methods
PerformanceEntry.toJSON()-
Returns a JSON representation of the
PerformanceEntryobject.
Example
The following example checks all PerformanceEntry properties to see if the browser supports them and if so, write their values to the console.
function print_PerformanceEntries() {
// Use getEntries() to get a list of all performance entries
var p = performance.getEntries();
for (var i = 0; i < p.length; i++) {
console.log("PerformanceEntry[" + i + "]");
print_PerformanceEntry(p[i]);
}
}
function print_PerformanceEntry(perfEntry) {
var properties = ["name", "entryType", "startTime", "duration"];
for (var i = 0; i < properties.length; i++) {
// Check each property
var supported = properties[i] in perfEntry;
if (supported) {
var value = perfEntry[properties[i]];
console.log("... " + properties[i] + " = " + value);
} else {
console.log("... " + properties[i] + " is NOT supported");
}
}
}
ëª ì¸ì
| Specification |
|---|
| Performance Timeline > # performanceentry > |