Baseline Widely available
Note: This feature is available in Web Workers.
The setResourceTimingBufferSize()
method sets the desired size of the browser's resource timing buffer which stores the "resource"
performance entries.
The specification requires the resource timing buffer initially to be 250 or greater.
To clear the browser's performance resource data buffer, use the Performance.clearResourceTimings()
method.
To get notified when the browser's resource timing buffer is full, listen for the resourcetimingbufferfull
event.
setResourceTimingBufferSize(maxSize)
Parameters
maxSize
A number
representing the maximum number of PerformanceEntry
objects the browser should hold in its performance entry buffer.
None (undefined
).
The following call allows 500 "resource"
performance entries in the browser's performance timeline.
performance.setResourceTimingBufferSize(500);
If you set the buffer size to a number lower than the amount of current entries in the buffer, no entries will be removed. Instead, to clear the buffer, call Performance.clearResourceTimings()
.
performance.getEntriesByType("resource").length; // 20
performance.setResourceTimingBufferSize(10);
performance.getEntriesByType("resource").length; // 20
performance.clearResourceTimings();
performance.getEntriesByType("resource").length; // 0
Specifications Browser compatibility See also
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4