performance.setResourceTimingBufferSize()

The setResourceTimingBufferSize() method sets the browser's resource timing buffer size to the specified number of "resource" performance entry type objects.

A browser's recommended resource timing buffer size is at least 150 performance entry objects.

Note: This feature is available in Web Workers

Syntax

performance.setResourceTimingBufferSize(maxSize);

Arguments

maxSize

A number representing the maximum number of performance entry objects the browser should hold in its performance entry buffer.

Return value

none

This method has no return value.

Example

function setResourceTimingBufferSize(maxSize) {
  if (performance === undefined) {
    log("Browser does not support Web Performance");
    return;
  }
  var supported = typeof performance.setResourceTimingBufferSize == "function";
  if (supported) {
    log("... Performance.setResourceTimingBufferSize() = Yes");
    performance.setResourceTimingBufferSize(maxSize);
  } else {
    log("... Performance.setResourceTimingBufferSize() = NOT supported");
  }
}

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
setResourceTimingBufferSize
46
22-57
12
35
10
Yes
11
46
≤37-57
46
25-57
35
Yes
No
5.0
1.5-7.0

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Performance/setResourceTimingBufferSize