The clearMarks()
method removes the named mark from the browser's performance entry buffer. If the method is called with no arguments, all performance entries
with an entry type
of "mark
" will be removed from the performance entry buffer.
clearMarks()
clearMarks(name)
The following example shows both uses of the clearMarks()
method.
function logMarkCount() {
console.log(
"Found this many entries: " + performance.getEntriesByType("mark").length
);
}
performance.mark("squirrel");
performance.mark("squirrel");
performance.mark("monkey");
performance.mark("monkey");
performance.mark("dog");
performance.mark("dog");
logMarkCount()
performance.clearMarks('squirrel');
logMarkCount()
performance.clearMarks();
logMarkCount()