--- title: performance.clearMeasures() slug: Web/API/Performance/clearMeasures tags: - API - Referencia - Rendimiento Web - metodo translation_of: Web/API/Performance/clearMeasures ---
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}}
performance.clearMeasures(); performance.clearMeasures(name);
measure
" serán eliminados.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"
Especificación | Estado | Comentario |
---|---|---|
{{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. |
{{Compat("api.Performance.clearMeasures")}}