performance global property
The global performance
property returns a Performance
object, which can be used to gather performance information about the context it is called in (window or worker).
Performance entries are per context. If you create a mark on the main thread (or other worker), you cannot see it in a worker thread, and vice versa.
Value
A Performance
object offering access to performance and timing-related information for the context it is called on (window or worker).
Performance API availability
The following table provides an overview about the availability of the performance APIs in window and worker contexts.
API | Window | Worker |
---|---|---|
LargestContentfulPaint |
x | |
LayoutShift |
x | |
LayoutShiftAttribution |
x | |
Performance |
x | x |
PerformanceElementTiming |
x | |
PerformanceEntry |
x | x |
PerformanceEventTiming |
x | |
PerformanceLongTaskTiming |
x | |
PerformanceMark |
x | x |
PerformanceMeasure |
x | x |
PerformanceNavigation
Deprecated
|
x | |
PerformanceNavigationTiming |
x | |
PerformanceObserver |
x | x |
PerformanceObserverEntryList |
x | x |
PerformancePaintTiming |
x | |
PerformanceResourceTiming |
x | x |
PerformanceServerTiming |
x | x |
PerformanceTiming
Deprecated
|
x | |
TaskAttributionTiming |
x | |
VisibilityStateEntry |
x |
Specifications
Specification |
---|
High Resolution Time # the-performance-attribute |
Browser compatibility
BCD tables only load in the browser