files/en-us/web/api/performance/clearmarks/index.md
{{APIRef("Performance API")}}{{AvailableInWorkers}}
The clearMarks() method removes all or specific {{domxref("PerformanceMark")}} objects from the browser's performance timeline.
clearMarks()
clearMarks(name)
name {{optional_inline}}
"mark" will be removed.None ({{jsxref("undefined")}}).
To clean up all performance marks, or just specific entries, use the clearMarks() method like this:
// Create a bunch of marks
performance.mark("login-started");
performance.mark("login-started");
performance.mark("login-finished");
performance.mark("form-sent");
performance.mark("video-loaded");
performance.mark("video-loaded");
performance.getEntriesByType("mark").length; // 6
// Delete just the "login-started" mark entries
performance.clearMarks("login-started");
performance.getEntriesByType("mark").length; // 4
// Delete all of the mark entries
performance.clearMarks();
performance.getEntriesByType("mark").length; // 0
{{Specifications}}
{{Compat}}