Web APIs
performance.measure()
Creates a PerformanceMeasure entry for an interval. Named marks or allowed explicit numeric times can define endpoints.
Formal Syntax & Structure
javascript syntaxjavascript
performance.measure(name, [startMarkOrOptions], [endMark])Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| name | string | Measure name. |
| startMarkOrOptions | string | PerformanceMeasureOptions | Start mark or options. |
| endMark | string | End mark name. |
Return Value
PerformanceMeasure
New interval entry.
Working Example
Example Snippetjavascript
(async () => {performance.mark("v16-a",{startTime:10});performance.mark("v16-b",{startTime:35});const m=performance.measure("v16-span","v16-a","v16-b");console.log(m.startTime,m.duration);performance.clearMarks("v16-a");performance.clearMarks("v16-b");performance.clearMeasures("v16-span");})()