Web APIs

performance.clearMarks()

Try the free JavaScript compiler

Remove stored marks by name or clear all marks when the name is omitted. This does not remove measures. Example console output: 0 1.

Formal Syntax & Structure

javascript syntaxjavascript
performance.clearMarks([name])

Parameters & Attributes

NameTypeDescription
namestringMark name, or omit to clear all marks.

Return Value

undefined

No result value.

Working Example

Example Snippetjavascript
performance.mark("a"); performance.mark("b"); performance.clearMarks("a"); console.log(performance.getEntriesByName("a").length,performance.getEntriesByName("b").length);
JavaScript Reference