--- title: Performance slug: Web/API/Performance tags: - API - Interface - Navigation Timing - NeedsTranslation - Performance - Reference - TopicStub - Web Performance translation_of: Web/API/Performance ---
The Performance
interface provides access to performance-related information for the current page. It's part of the High Resolution Time API, but is enhanced by the Performance Timeline API, the Navigation Timing API, the User Timing API, and the Resource Timing API.
An object of this type can be obtained by calling the {{domxref("Window.performance")}} read-only attribute.
Note: This interface and its members are available in Web Workers, except where indicated below. Also note that performance markers and measures 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.
The Performance
interface doesn't inherit any properties.
timing
, including whether the page was a load or a refresh, how many redirections occurred, and so forth. Not available in workers.The Performance
interface doesn't inherit any methods.
resource
" from the browser's performance data buffer.resource
" {{domxref("PerformanceEntry.entryType","type")}} {{domxref("PerformanceEntry","performance entry")}} objects.Performance
object.Specification | Status | Comment |
---|---|---|
{{SpecName('Highres Time Level 2', '#the-performance-interface', 'toJSON()')}} | {{Spec2('Highres Time Level 2')}} | Defines toJson() method. |
{{SpecName('Highres Time', '#the-performance-interface', 'Performance')}} | {{Spec2('Highres Time')}} | Defines now() method. |
{{SpecName('Navigation Timing', '#sec-window.performance-attribute', 'Performance')}} | {{Spec2('Navigation Timing')}} | Defines timing and navigation properties. |
{{SpecName('Performance Timeline Level 2', '#extensions-to-the-performance-interface', 'Performance extensions')}} | {{Spec2('Performance Timeline Level 2')}} | Changes getEntries() interface. |
{{SpecName('Performance Timeline', '#sec-window.performance-attribute', 'Performance extensions')}} | {{Spec2('Performance Timeline')}} | Defines getEntries() , getEntriesByType() and getEntriesByName() methods. |
{{SpecName('Resource Timing', '#extensions-performance-interface', 'Performance extensions')}} | {{Spec2('Resource Timing')}} | Defines clearResourceTimings() and setResourceTimingBufferSize() methods and the onresourcetimingbufferfull property. |
{{SpecName('User Timing Level 2', '#extensions-performance-interface', 'Performance extensions')}} | {{Spec2('User Timing Level 2')}} | Clarifies mark() , clearMark() , measure() and clearMeasure() methods. |
{{SpecName('User Timing', '#extensions-performance-interface', 'Performance extensions')}} | {{Spec2('User Timing')}} | Defines mark() , clearMark() , measure() and clearMeasure() methods. |
{{Compat("api.Performance")}}