Web APIs

performance.getEntriesByName()

Try the free JavaScript compiler

Returns a snapshot of entries matching a name and optional type. Names may be reused, so more than one result is possible.

Formal Syntax & Structure

javascript syntaxjavascript
performance.getEntriesByName(name, [type])

Parameters & Attributes

NameTypeDescription
namestringEntry name.
typestringOptional entry type.

Return Value

PerformanceEntry[]

Matching snapshot entries.

Working Example

Example Snippetjavascript
(async () => {performance.mark("same",{startTime:2});const first=performance.getEntriesByName("same","mark");performance.mark("same",{startTime:3});console.log(first.length,performance.getEntriesByName("same","mark").length);performance.clearMarks("same");})()
JavaScript Reference