Web APIs
performance.getEntriesByType()
Returns a snapshot of buffered timeline entries matching the given type, ordered by startTime. Unsupported or observer-only types can yield an empty array.
Formal Syntax & Structure
javascript syntaxjavascript
performance.getEntriesByType(type)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| type | string | Entry type. |
Return Value
PerformanceEntry[]
Matching entries.
Working Example
Example Snippetjavascript
(async () => {performance.mark("late",{startTime:20});performance.mark("early",{startTime:5});console.log(performance.getEntriesByType("mark").map(x=>x.name).join(","));performance.clearMarks("late");performance.clearMarks("early");})()