Web APIs
performance.getEntriesByName()
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
| Name | Type | Description |
|---|---|---|
| name | string | Entry name. |
| type | string | Optional 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");})()