Web APIs

performance.getEntriesByType()

Try the free JavaScript compiler

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

NameTypeDescription
typestringEntry 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");})()
JavaScript Reference