Performance: getEntriesByName() method

Baseline Widely available

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:

To access entries of these types, you must use a PerformanceObserver instead.

Syntax

js
getEntriesByName(name)
getEntriesByName(name, type)

Parameters

name

The name of the entries to retrieve.

type Optional

The type of entries to retrieve such as "mark". The valid entry types are listed in PerformanceEntry.entryType.

Return value

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.

Examples

Logging performance markers

The following example logs all PerformanceMark objects named "debug-mark".

js
const debugMarks = performance.getEntriesByName("debug-mark", "mark");
debugMarks.forEach((entry) => {
  console.log(`${entry.name}'s startTime: ${entry.startTime}`);
});

Specifications

Specification
Performance Timeline
# dom-performance-getentriesbyname

Browser compatibility

desktop mobile server
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Bun
Deno
Node.js
getEntriesByName
Chrome – No support
Chrome 25 – 35 (Release date: 2013-02-21)
prefix
footnote Removed in 36 and later
prefix Implemented with the vendor prefix: webkit
Chrome – Full support
Chrome 28 (Release date: 2013-07-09)
footnote Full support
Edge – Full support
Edge 12 (Release date: 2015-07-29)
footnote Full support
Firefox – Full support
Firefox 35 (Release date: 2015-01-13)
footnote Full support
Opera – No support
Opera 15 – 22 (Release date: 2013-07-02)
prefix
footnote Removed in 23 and later
prefix Implemented with the vendor prefix: webkit
Opera – Full support
Opera 15 (Release date: 2013-07-02)
footnote Full support
Safari – Full support
Safari 11 (Release date: 2017-09-19)
footnote Full support
Chrome Android – No support
Chrome Android 25 – 35 (Release date: 2013-02-27)
prefix
footnote Removed in 36 and later
prefix Implemented with the vendor prefix: webkit
Chrome Android – Full support
Chrome Android 28 (Release date: 2013-07-10)
footnote Full support
Firefox for Android – Full support
Firefox for Android 35 (Release date: 2015-01-13)
footnote Full support
Opera Android – No support
Opera Android 14 – 22 (Release date: 2013-05-21)
prefix
footnote Removed in 24 and later
prefix Implemented with the vendor prefix: webkit
Opera Android – Full support
Opera Android 15 (Release date: 2013-07-08)
footnote Full support
Safari on iOS – Full support
Safari on iOS 11 (Release date: 2017-09-19)
footnote Full support
Samsung Internet – No support
Samsung Internet 1.5 – 2.1 (Release date: 2013-09-25)
prefix
footnote Removed in 3 and later
prefix Implemented with the vendor prefix: webkit
Samsung Internet – Full support
Samsung Internet 1.5 (Release date: 2013-09-25)
footnote Full support
WebView Android – Full support
WebView Android 4.4 (Release date: 2013-12-09)
footnote Full support
WebView on iOS – Full support
WebView on iOS 11 (Release date: 2017-09-19)
footnote Full support
Bun – Full support
Bun 1.0.7 (Release date: 2023-10-20)
footnote Full support
Deno – Full support
Deno 1.2 (Release date: 2020-07-13)
footnote Full support
Node.js – Full support
Node.js 16.7 (Release date: 2021-08-17)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Requires a vendor prefix or different name for use.
Has more compatibility info.

See also