---
title: performance.clearMarks()
slug: Web/API/Performance/clearMarks
tags:
  - API
  - Referencia
  - Rendimiento Web
  - metodo
translation_of: Web/API/Performance/clearMarks
---
<div>{{APIRef("User Timing API")}}</div>

<p>El método <strong><code>clearMarks()</code></strong> elimina la <em>marca llamada</em> del búfer de rendimiento de entrada del navegador. Si el método es llamado sin argumentos, todos los {{domxref("PerformanceEntry","performance entries")}} con un {{domxref("PerformanceEntry.entryType","entry type")}} de "<code>mark</code>" serán eliminados del búfer de rendimiento de entrada.</p>

<p>{{AvailableInWorkers}}</p>

<h2 id="Sintaxis">Sintaxis</h2>

<pre class="syntaxbox"><em>performance</em>.clearMarks();
<em>performance</em>.clearMarks(name);
</pre>

<h3 id="Argumentos">Argumentos</h3>

<dl>
 <dt>nombre {{optional_inline}}</dt>
 <dd>Un {{domxref("DOMString")}} representando el nombre de la marca de tiempo. Si este argumento es omitido, todos los {{domxref("PerformanceEntry","performance entries")}} con un {{domxref("PerformanceEntry.entryType","entry type")}} de "<code>mark</code>" serán eliminados.</dd>
</dl>

<h3 id="Valor_de_retorno">Valor de retorno</h3>

<dl>
 <dt>vacío</dt>
 <dd></dd>
</dl>

<h2 id="Ejemplo">Ejemplo</h2>

<p>El siguiente ejemplo muestra ambos usos del método <code>clearMarks()</code>.</p>

<pre class="brush: js">// Create a small helper to show how many PerformanceMark entries there are.
function logMarkCount() {
  console.log(
    "Found this many entries: " + performance.getEntriesByType("mark").length
  );
}

// Create a bunch of marks.
performance.mark("squirrel");
performance.mark("squirrel");
performance.mark("monkey");
performance.mark("monkey");
performance.mark("dog");
performance.mark("dog");

logMarkCount() // "Found this many entries: 6"

// Delete just the "squirrel" PerformanceMark entries.
performance.clearMarks('squirrel');
logMarkCount() // "Found this many entries: 4"

// Delete all of the PerformanceMark entries.
performance.clearMarks();
logMarkCount() // "Found this many entries: 0"
</pre>

<h2 id="Especificaciones">Especificaciones</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Especificación</th>
   <th scope="col">Estado</th>
   <th scope="col">Comentario</th>
  </tr>
  <tr>
   <td>{{SpecName('User Timing Level 2', '#dom-performance-clearmarks', 'clearMarks()')}}</td>
   <td>{{Spec2('User Timing Level 2')}}</td>
   <td>Se clarifica <code>clearMarks()</code>.</td>
  </tr>
  <tr>
   <td>{{SpecName('User Timing', '#dom-performance-clearmarks', 'clearMarks()')}}</td>
   <td>{{Spec2('User Timing')}}</td>
   <td>Definición básica.</td>
  </tr>
 </tbody>
</table>

<h2 id="Compatibilidad_de_navegadores">Compatibilidad de navegadores</h2>

<div>


<p>{{Compat("api.Performance.clearMarks")}}</p>
</div>