coderef

PerformanceBaseline · Widely available

The performance global object and the PerformanceObserver API provide access to performance-related information for the current execution context.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Sep 16, 2015. Widely available since Mar 16, 2018.

Browser support

DesktopChrome
1–5Not supported
6+Supportedsince Sep 2, 2010
Current: 155
Edge
12+Supportedsince Jul 29, 2015
Current: 154
Firefox
1–6Not supported
7+Supportedsince Sep 27, 2011
Current: 157
Safari
1–7Not supported
8+Supportedsince Oct 16, 2014
Current: 27
MobileChrome Android
18+Supportedsince Jun 27, 2012
Current: 155
Firefox Android
4–6Not supported
7+Supportedsince Sep 27, 2011
Current: 157
Safari iOS
1–8Not supported
9+Supportedsince Sep 16, 2015
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: Performance.

Feature detection

JS · check before using
if ("Performance" in globalThis) {
  // Performance is available
} else {
  // load a polyfill or use a fallback
}

Sub-features

Support for each part of the feature (42). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
Performance612781879
Performance.clearMarks29123811294211
Performance.clearMeasures29123811294211
Performance.getEntries28123511283511
Performance.getEntriesByName28123511283511
Performance.getEntriesByType28123511283511
Performance.mark28123811284211
Performance.mark.markOptions_parameter787910114.17810114.5
Performance.mark.returns_performancemark787910114.17810114.5
Performance.measure28123811284211
Performance.measure.measureOptions_parameter777910314.17710314.5
Performance.measure.returns_performancemeasure787910314.17810314.5
Performance.now241215825159
Performance.timeOrigin62165315625315
Performance.toJSON56122514.1562514.5
PerformanceEntry46123511463511
PerformanceEntry.duration46123511463511
PerformanceEntry.entryType46123511463511
PerformanceEntry.name46123511463511
PerformanceEntry.startTime46123511463511
Show 22 more
Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
PerformanceEntry.toJSON46163511463511
PerformanceEntry.worker_support62156011626011
PerformanceMark28123811283811
PerformanceMark.PerformanceMark767910114.17610114.5
PerformanceMark.detail787910114.17810114.5
PerformanceMeasure25123811253811
PerformanceMeasure.detail787910314.17810314.5
PerformanceObserver52795711525711
PerformanceObserver.PerformanceObserver52795711525711
PerformanceObserver.PerformanceObserver.droppedEntriesCount9595✕✕95✕✕
PerformanceObserver.disconnect52795711525711
PerformanceObserver.observe52795711525711
PerformanceObserver.supportedEntryTypes_static73796813736813
PerformanceObserver.takeRecords65796015656015
PerformanceObserver.worker_support62795711625711
PerformanceObserverEntryList52795711525711
PerformanceObserverEntryList.getEntries52795711525711
PerformanceObserverEntryList.getEntriesByName52795711525711
PerformanceObserverEntryList.getEntriesByType52795711525711
performance612781879
performance.worker_support30143411303411
http.headers.Timing-Allow-Origin54794511544511