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.
performance.clearMeasures(); performance.clearMeasures(name);
DOMString representing the name of the timestamp. If this argument is omitted, all performance entries with an entry type of "measure" will be removed.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();
}
| 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. |
| Desktop | ||||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
| Basic support | 43 | Yes | 41 | 10 | 33 | 11 |
| Mobile | |||||||
|---|---|---|---|---|---|---|---|
| Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
| Basic support | 46 | 46 | Yes | 42 | 33 | 11 | ? |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Performance/clearMeasures