From 1109132f09d75da9a28b649c7677bb6ce07c40c0 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:41:45 -0500 Subject: initial commit --- .../web/api/performance/clearmeasures/index.html | 96 ++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 files/es/web/api/performance/clearmeasures/index.html (limited to 'files/es/web/api/performance/clearmeasures') diff --git a/files/es/web/api/performance/clearmeasures/index.html b/files/es/web/api/performance/clearmeasures/index.html new file mode 100644 index 0000000000..63fa0dd936 --- /dev/null +++ b/files/es/web/api/performance/clearmeasures/index.html @@ -0,0 +1,96 @@ +--- +title: performance.clearMeasures() +slug: Web/API/Performance/clearMeasures +tags: + - API + - Referencia + - Rendimiento Web + - metodo +translation_of: Web/API/Performance/clearMeasures +--- +
{{APIRef("User Timing API")}}
+ +

El método clearMeasures() elimina la medida llamada 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 "measure" serán eliminados del búfer de rendimiento de entrada.

+ +

{{AvailableInWorkers}}

+ +

Sintaxis

+ +
performance.clearMeasures();
+performance.clearMeasures(name);
+
+ +

Argumentos

+ +
+
nombre {{optional_inline}}
+
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 "measure" serán eliminados.
+
+ +

Valor de retorno

+ +
+
vacío
+
+
+ +

Ejemplo

+ +

En el siguiente ejemplo se muestran los dos usos del método clearMeasures() .

+ +
// 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"
+
+ +

Especificaciones

+ + + + + + + + + + + + + + + + + + + +
EspecificaciónEstadoComentario
{{SpecName('User Timing Level 2', '#dom-performance-clearmeasures', 'clearMeasures()')}}{{Spec2('User Timing Level 2')}}Se clarifica clearMeasures().
{{SpecName('User Timing', '#dom-performance-clearmeasures', 'clearMeasures()')}}{{Spec2('User Timing')}}Definición básica.
+ +

Compatibilidad de navegadores

+ +
+ + +

{{Compat("api.Performance.clearMeasures")}}

+
-- cgit v1.2.3-54-g00ecf