Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

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.

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
The definition of 'clearMarks()' in that specification.
Editor's Draft Clarifies clearMarks().
User Timing
The definition of 'clearMarks()' in that specification.
Recommendation Basic definition.

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 43.0 41 10 33 No support
Feature Android Android Webview Firefox Mobile (Gecko) Firefox OS IE Phone Opera Mobile Safari Mobile Chrome for Android
Basic support No support 46.0 42 42 10 33 No support 46.0

文档标签和贡献者

 此页面的贡献者: jpmedley, rolfedh, AFBarstow
 最后编辑者: jpmedley,