This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2017.
Note: This feature is available in Web Workers.
The clearMeasures() method removes all or specific PerformanceMeasure objects from the browser's performance timeline.
clearMeasures() clearMeasures(name)
name OptionalA string representing the name of the PerformanceMeasure object. If this argument is omitted, all entries with an entryType of "measure" will be removed.
None (undefined).
To clean up all performance measure, or just specific entries, use the clearMeasures() method like this:
// Create a bunch of measures
performance.measure("from navigation");
performance.mark("a");
performance.measure("from mark a", "a");
performance.measure("from navigation");
performance.measure("from mark a", "a");
performance.mark("b");
performance.measure("between a and b", "a", "b");
performance.getEntriesByType("measure").length; // 5
// Delete just the "from navigation" measure entries
performance.clearMeasures("from navigation");
performance.getEntriesByType("measure").length; // 3
// Delete all of the measure entries
performance.clearMeasures();
performance.getEntriesByType("measure").length; // 0
| Specification |
|---|
| User Timing> # dom-performance-clearmeasures> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
clearMeasures |
2925–29 | 12 | 38 | 33 | 11 | 2925–29 | 42 | 33 | 11 | 2.01.5–2.0 | 4.4 | 11 |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Performance/clearMeasures