aboutsummaryrefslogtreecommitdiff
path: root/files/es/web/api/performance/clearmeasures/index.html
blob: 63fa0dd936dabeec13bd3ee68308ab1a1a8dd4a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
---
title: performance.clearMeasures()
slug: Web/API/Performance/clearMeasures
tags:
  - API
  - Referencia
  - Rendimiento Web
  - metodo
translation_of: Web/API/Performance/clearMeasures
---
<div>{{APIRef("User Timing API")}}</div>

<p>El método <strong><code>clearMeasures()</code></strong> elimina <em>la medida llamada </em>del búfer de rendimiento de entrada, si el método es llamado sin argumentos, todos los {{domxref("PerformanceEntry","performance entries")}} con un {{domxref("PerformanceEntry.entryType","entry type")}} de "<code>measure</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>.clearMeasures();
<em>performance</em>.clearMeasures(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 el argumento se omite, todos los {{domxref("PerformanceEntry","performance entries")}} con un {{domxref("PerformanceEntry.entryType","entry type")}} de "<code>measure</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>En el siguiente ejemplo se muestran los dos usos del método <code>clearMeasures()</code> .</p>

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

// Create a bunch of measures.
performance.measure("from navigation");
performance.mark("a");
performance.measure("from mark a", "a");
performance.measure("from navigation");
performance.measure("from mark a", "a");
performance.mark("b");
performance.measure("between a and b", "a", "b");

logMeasureCount() // "Found this many entries: 5"

// Delete just the "from navigation" PerformanceMeasure entries.
performance.clearMeasures("from navigation");
logMeasureCount() // "Found this many entries: 3"

// Delete all of the PerformanceMeasure entries.
performance.clearMeasures();
logMeasureCount() // "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-clearmeasures', 'clearMeasures()')}}</td>
   <td>{{Spec2('User Timing Level 2')}}</td>
   <td>Se clarifica <code>clearMeasures()</code>.</td>
  </tr>
  <tr>
   <td>{{SpecName('User Timing', '#dom-performance-clearmeasures', 'clearMeasures()')}}</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.clearMeasures")}}</p>
</div>