Performance
{{APIRef("Performance API")}}
{{AvailableInWorkers}}
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 {{domxref("Window.performance")}}
, and for code running in a worker via {{domxref("WorkerGlobalScope.performance")}}
.
{{InheritanceDiagram}}
Instance properties
The Performance
interface doesn’t inherit any properties.
-
{{domxref("Performance.eventCounts")}}
{{ReadOnlyInline}}
- : An
{{domxref("EventCounts")}}
map containing the number of events which have been dispatched per event type.
- : An
-
{{domxref("Performance.navigation")}}
{{ReadOnlyInline}}
{{Deprecated_Inline}}
- : A legacy
{{domxref("PerformanceNavigation")}}
object 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
-
{{domxref("Performance.timing")}}
{{ReadOnlyInline}}
{{Deprecated_Inline}}
- : A legacy
{{domxref("PerformanceTiming")}}
object containing latency-related performance information.
- : A legacy
-
{{domxref("Performance.memory")}}
{{ReadOnlyInline}}
{{Non-standard_Inline}}
{{Deprecated_Inline}}
- : 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.
-
{{domxref("Performance.timeOrigin")}}
{{ReadOnlyInline}}
- : Returns the high resolution timestamp of the start time of the performance measurement.
Instance methods
The Performance
interface doesn’t inherit any methods.
{{domxref("Performance.clearMarks()")}}
- : Removes the given mark from the browser’s performance entry buffer.
{{domxref("Performance.clearMeasures()")}}
- : Removes the given measure from the browser’s performance entry buffer.
{{domxref("Performance.clearResourceTimings()")}}
- : Removes all performance entries with a
{{domxref("PerformanceEntry.entryType","entryType")}}
of"resource"
from the browser’s performance data buffer.
- : Removes all performance entries with a
{{domxref("Performance.getEntries()")}}
- : Returns a list of
{{domxref("PerformanceEntry")}}
objects based on the given filter.
- : Returns a list of
{{domxref("Performance.getEntriesByName()")}}
- : Returns a list of
{{domxref("PerformanceEntry")}}
objects based on the given name and entry type.
- : Returns a list of
{{domxref("Performance.getEntriesByType()")}}
- : Returns a list of
{{domxref("PerformanceEntry")}}
objects of the given entry type.
- : Returns a list of
{{domxref("Performance.mark()")}}
- : Creates a
{{domxref("DOMHighResTimeStamp","timestamp")}}
in the browser’s performance entry buffer with the given name.
- : Creates a
{{domxref("Performance.measure()")}}
- : Creates a named
{{domxref("DOMHighResTimeStamp","timestamp")}}
in the browser’s performance entry buffer between two specified marks (known as the start mark and end mark, respectively).
- : Creates a named
{{domxref("Performance.measureUserAgentSpecificMemory()")}}
{{Experimental_Inline}}
- : Estimates the memory usage of a web application including all its iframes and workers.
{{domxref("Performance.now()")}}
- : Returns a
{{domxref("DOMHighResTimeStamp")}}
representing the number of milliseconds elapsed since a reference instant.
- : Returns a
{{domxref("Performance.setResourceTimingBufferSize()")}}
- : Sets the browser’s resource timing buffer size to the specified number of
"resource"
{{domxref("PerformanceEntry.entryType","type")}}
{{domxref("PerformanceEntry")}}
objects.
- : Sets the browser’s resource timing buffer size to the specified number of
{{domxref("Performance.toJSON()")}}
- : Returns a JSON representation of the
Performance
object.
- : 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.
{{DOMxRef("Performance.resourcetimingbufferfull_event", "resourcetimingbufferfull")}}
- : Fired when the browser’s resource timing buffer is full.
Specifications
{{Specifications}}
Browser compatibility
{{Compat}}