files/en-us/web/api/performance/clearmeasures/index.md
{{APIRef("Performance API")}}{{AvailableInWorkers}}
The clearMeasures() method removes all or specific {{domxref("PerformanceMeasure")}} objects from the browser's performance timeline.
clearMeasures()
clearMeasures(name)
name {{optional_inline}}
"measure" will be removed.None ({{jsxref("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
{{Specifications}}
{{Compat}}