The clearMeasures()
method removes the named measure from the browser's performance entry buffer. If the method is called with no arguments, all performance entries
with an entry type
of "measure
" will be removed from the performance entry buffer.
clearMeasures()
clearMeasures(name)
The following example shows both uses of the clearMeasures()
method.
function logMeasureCount() {
console.log(
"Found this many entries: " + performance.getEntriesByType("measure").length
);
}
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");
logMeasureCount()
performance.clearMeasures("from navigation");
logMeasureCount()
performance.clearMeasures();
logMeasureCount()