Performance.clearMeasures()

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.

Note: This feature is available in Web Workers.

Syntax

performance.clearMeasures();
performance.clearMeasures(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 "measure" will be removed.

Return value

void
 

Example

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

function clear_measure(name) {
  if (performance.clearMeasures === undefined) {
    console.log("performance.clearMeasures Not supported");
    return;
  }
  // Remove all "measure" performance entry types with the specified name
  performance.clearMeasures(name);
}
function clear_all_measures() {
  if (performance.clearMeasures === undefined) {
    console.log("performance.clearMeasures Not supported");
    return;
  }
  // Remove all "measure" type performance entries from the performance buffer
  performance.clearMeasures();
}

Specifications

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

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic supportChrome Full support 43Edge Full support YesFirefox Full support 41IE Full support 10Opera Full support 33Safari Full support 11WebView Android Full support 46Chrome Android Full support 46Edge Mobile Full support YesFirefox Android Full support 42Opera Android Full support 33Safari iOS Full support 11Samsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown

Document Tags and Contributors

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