Performance.clearMarks()

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.

Note: This feature is available in Web Workers.

Syntax

performance.clearMarks();
performance.clearMarks(name);

Arguments

name Optional
A DOMString representing the name of the timestamp. If this argument is omitted, all performance entries with an entry type of "mark" will be removed.

Return value

void
 

Example

The following example shows both uses of the clearMarks() method.

function clear_mark(name) {
  if (performance.clearMarks === undefined) {
    console.log("performance.clearMarks Not supported");
    return;
  }
  // Remove all "mark" performance entry types with the specified name
  performance.clearMarks(name);
}
function clear_all_marks() {
  if (performance.clearMarks === undefined) {
    console.log("performance.clearMarks Not supported");
    return;
  }
  // Remove all "mark" type performance entries from the performance buffer
  performance.clearMarks();
}

Specifications

Specification Status Comment
User Timing Level 2
The definition of 'clearMarks()' in that specification.
Working Draft Clarifies clearMarks().
User Timing
The definition of 'clearMarks()' in that specification.
Recommendation Basic definition.

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support43 Yes411033 No
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support4646 Yes4233 No ?

Document Tags and Contributors

Contributors to this page: fscholz, chrisdavidmills, abbycar, jpmedley, rolfedh, AFBarstow
Last updated by: fscholz,