Performance API
PerformanceMeasure is an abstract interface for PerformanceEntry objects with an PerformanceEntry.entryType of "measure". Entries of this type are created by calling Performance.measure to add a named DOMHighResTimeStamp (the measure) between two marks to the browser's performance timeline.
Instance properties
- PerformanceMeasure.detail
- : Contains arbitrary metadata about the measure.
This interface extends the following PerformanceEntry properties by qualifying/constraining the properties as follows:
- PerformanceEntry.entryType
- : Returns
"measure".
- : Returns
- PerformanceEntry.name
- : Returns the name given to the measure when it was created via a call to Performance.measure().
- PerformanceEntry.startTime
- : Returns a DOMHighResTimeStamp given to the measure when Performance.measure() was called.
- PerformanceEntry.duration
- : Returns a 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.
Examples
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
Browser compatibility
See also
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
