PerformanceEntry.entryType
The entryType
property returns the performance entry's
type. The valid entryType
values are:
- "
frame
" - the performance entry is aPerformanceFrameTiming
object. - "
mark
" - the performance entry is aPerformanceMark
object. - "
measure
" - the performance entry is aPerformanceMeasure
object. - "
navigation
" - the performance entry is aPerformanceNavigationTiming
object. - "
resource
" - the performance entry is aPerformanceResourceTiming
object. - "
server
" - the performance entry is aPerformanceServerTiming
object.
This property is Read only .
Syntax
JavaScript
Copy Code
entry.entryType;
Return value
A DOMString
representing the type of interface the performance entry
represents. The return value is one of the strings listed above.
Example
The following example shows the use of the entryType
property.
JavaScript
Copy Code
function run_PerformanceEntry() { // check for feature support before continuing if (performance.mark === undefined) { console.log("performance.mark not supported"); return; } // Create a performance entry named "begin" via the mark() method performance.mark("begin"); // Check the entryType of all the "begin" entries var entriesNamedBegin = performance.getEntriesByName("begin"); for (var i=0; i < entriesNamedBegin.length; i++) { var typeOfEntry = entriesNamedBegin[i].entryType; console.log("Entry is type: " + typeOfEntry); } }
Specifications
Specification | Status | Comment |
---|---|---|
Performance Timeline Time Level 2 The definition of 'entryType' in that specification. |
Editor's Draft | |
Performance Timeline The definition of 'entryType' in that specification. |
Recommendation | Initial definition. |
Browser compatibility
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support. | (Yes) | (Yes) | (Yes) | (Yes) | Not supported |
Feature | Android | Firefox Mobile (Gecko) | Firefox OS | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support. | (Yes) | 25.0 (25.0) | 1.2 (25.0) | 10.0 | (Yes) | Not supported |
License
© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/api/performanceentry/entrytype