This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2017.
Note: This feature is available in Web Workers.
The getEntriesByName() method returns an array of PerformanceEntry objects currently present in the performance timeline with the given name and type.
If you are interested in performance entries of certain types, see getEntriesByType(). For all performance entries, see getEntries().
Note: This method does not notify you about new performance entries; you will only get entries that are present in the performance timeline at the time you call this method. To receive notifications about entries as they become available, use a PerformanceObserver.
The following entry types are not supported by this method at all and won't be returned even if entries for these types might exist:
"element" (PerformanceElementTiming)"event" (PerformanceEventTiming)"largest-contentful-paint" (LargestContentfulPaint)"layout-shift" (LayoutShift)"longtask" (PerformanceLongTaskTiming)To access entries of these types, you must use a PerformanceObserver instead.
getEntriesByName(name) getEntriesByName(name, type)
nameThe name of the entries to retrieve.
type OptionalThe type of entries to retrieve such as "mark". The valid entry types are listed in PerformanceEntry.entryType.
An Array of PerformanceEntry objects that have the specified name and type. The items will be in chronological order based on the entries' startTime. If no objects meet the specified criteria, an empty array is returned.
The following example logs all PerformanceMark objects named "debug-mark".
const debugMarks = performance.getEntriesByName("debug-mark", "mark");
debugMarks.forEach((entry) => {
console.log(`${entry.name}'s startTime: ${entry.startTime}`);
});
| Specification |
|---|
| Performance Timeline> # dom-performance-getentriesbyname> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
getEntriesByName |
2825–36 | 12 | 35 | 1515–23 | 11 | 2825–36 | 35 | 1514–24 | 11 | 1.51.5–3.0 | 4.4 | 11 |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Performance/getEntriesByName