Back to Content

PerformanceMeasure

files/en-us/web/api/performancemeasure/index.md

latest2.2 KB
Original Source

{{APIRef("Performance API")}}{{AvailableInWorkers}}

PerformanceMeasure is an abstract interface for {{domxref("PerformanceEntry")}} objects with an {{domxref("PerformanceEntry.entryType","entryType")}} of "measure". Entries of this type are created by calling {{domxref("Performance.measure","performance.measure()")}} to add a named {{domxref("DOMHighResTimeStamp")}} (the measure) between two marks to the browser's performance timeline.

{{InheritanceDiagram}}

Instance properties

  • {{domxref("PerformanceMeasure.detail")}}
    • : Contains arbitrary metadata about the measure.

This interface extends the following {{domxref("PerformanceEntry")}} properties by qualifying/constraining the properties as follows:

  • {{domxref("PerformanceEntry.entryType")}}
    • : Returns "measure".
  • {{domxref("PerformanceEntry.name")}}
    • : Returns the name given to the measure when it was created via a call to {{domxref("Performance.measure()","performance.measure()")}}.
  • {{domxref("PerformanceEntry.startTime")}}
    • : Returns a {{domxref("DOMHighResTimeStamp","timestamp")}} given to the measure when {{domxref("Performance.measure()","performance.measure()")}} was called.
  • {{domxref("PerformanceEntry.duration")}}
    • : Returns a {{domxref("DOMHighResTimeStamp")}} that is the duration of the measure (typically, the measure's end mark timestamp minus its start mark timestamp).

Instance methods

This interface has no methods.

Example

See the example in Using the User Timing API.

Chrome DevTools uses performance.measure() and in particular a structured detail property as part of its extensibility API that surfaces these in custom tracks in performance traces. See the example in Performance: measure() method page and the Chrome's extensibility API documentation for more information and examples.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also