web api interface
Performance
Available in workers
The Performance interface provides access to performance-related information for the current page.
Performance entries are specific to each execution context. You can access performance information for code running in a window via performance, and for code running in a worker via performance.
Instance properties
The Performance interface doesn’t inherit any properties.
eventCountsRead only- : An
EventCountsmap containing the number of events which have been dispatched per event type.
- : An
interactionCountRead only- : The number of real-user interactions that have occurred on the page, which is useful when calculating Interaction to Next Paint (INP).
navigationRead only Deprecated- : A legacy
PerformanceNavigationobject that provides useful context about the operations included in the times listed intiming, including whether the page was a load or a refresh, how many redirections occurred, and so forth.
- : A legacy
timingRead only Deprecated- : A legacy
PerformanceTimingobject containing latency-related performance information.
- : A legacy
memoryRead only Deprecated- : A non-standard extension added in Chrome, this property provides an object with basic memory usage information. You should not use this non-standard API.
timeOriginRead only- : Returns the high resolution timestamp of the start time of the performance measurement.
Instance methods
The Performance interface doesn’t inherit any methods.
clearMarks()- : Removes the given mark from the browser’s performance entry buffer.
clearMeasures()- : Removes the given measure from the browser’s performance entry buffer.
clearResourceTimings()- : Removes all performance entries with an
entryTypeof"resource"from the browser’s performance data buffer.
- : Removes all performance entries with an
getEntries()- : Returns a list of
PerformanceEntryobjects based on the given filter.
- : Returns a list of
getEntriesByName()- : Returns a list of
PerformanceEntryobjects based on the given name and entry type.
- : Returns a list of
getEntriesByType()- : Returns a list of
PerformanceEntryobjects of the given entry type.
- : Returns a list of
mark()- : Creates a
timestampin the browser’s performance entry buffer with the given name.
- : Creates a
measure()- : Creates a named
timestampin the browser’s performance entry buffer between two specified marks (known as the start mark and end mark, respectively).
- : Creates a named
measureUserAgentSpecificMemory()Experimental- : Estimates the memory usage of a web application including all its iframes and workers.
now()- : Returns a
DOMHighResTimeStamprepresenting the number of milliseconds elapsed since a reference instant.
- : Returns a
setResourceTimingBufferSize()- : Sets the browser’s resource timing buffer size to the specified number of
"resource"typePerformanceEntryobjects.
- : Sets the browser’s resource timing buffer size to the specified number of
toJSON()- : Returns a JSON representation of the
Performanceobject.
- : Returns a JSON representation of the
Events
Listen to these events using addEventListener() or by assigning an event listener to the oneventname property of this interface.
resourcetimingbufferfull- : Fired when the browser’s resource timing buffer is full.
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.