{
  "source": "doc/api/perf_hooks.md",
  "modules": [
    {
      "textRaw": "Performance Timing API",
      "name": "performance_timing_api",
      "introduced_in": "v8.5.0",
      "stability": 1,
      "stabilityText": "Experimental",
      "desc": "<p>The Performance Timing API provides an implementation of the\n<a href=\"https://w3c.github.io/performance-timeline/\">W3C Performance Timeline</a> specification. The purpose of the API\nis to support collection of high resolution performance metrics.\nThis is the same Performance API as implemented in modern Web browsers.</p>\n<pre><code class=\"lang-js\">const { performance } = require(&#39;perf_hooks&#39;);\nperformance.mark(&#39;A&#39;);\ndoSomeLongRunningProcess(() =&gt; {\n  performance.mark(&#39;B&#39;);\n  performance.measure(&#39;A to B&#39;, &#39;A&#39;, &#39;B&#39;);\n  const measure = performance.getEntriesByName(&#39;A to B&#39;)[0];\n  console.log(measure.duration);\n  // Prints the number of milliseconds between Mark &#39;A&#39; and Mark &#39;B&#39;\n});\n</code></pre>\n",
      "classes": [
        {
          "textRaw": "Class: Performance",
          "type": "class",
          "name": "Performance",
          "meta": {
            "added": [
              "v8.5.0"
            ],
            "changes": []
          },
          "desc": "<p>The <code>Performance</code> provides access to performance metric data. A single\ninstance of this class is provided via the <code>performance</code> property.</p>\n",
          "methods": [
            {
              "textRaw": "performance.clearEntries(name)",
              "type": "method",
              "name": "clearEntries",
              "meta": {
                "added": [
                  "v9.5.0"
                ],
                "changes": []
              },
              "desc": "<p>Remove all performance entry objects with <code>entryType</code> equal to <code>name</code> from the\nPerformance Timeline.</p>\n",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "name"
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "performance.clearFunctions([name])",
              "type": "method",
              "name": "clearFunctions",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string} ",
                      "name": "name",
                      "type": "string",
                      "optional": true
                    }
                  ]
                },
                {
                  "params": [
                    {
                      "name": "name",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>If <code>name</code> is not provided, removes all <code>PerformanceFunction</code> objects from the\nPerformance Timeline. If <code>name</code> is provided, removes entries with <code>name</code>.</p>\n"
            },
            {
              "textRaw": "performance.clearGC()",
              "type": "method",
              "name": "clearGC",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>Remove all performance entry objects with <code>entryType</code> equal to <code>gc</code> from the\nPerformance Timeline.</p>\n",
              "signatures": [
                {
                  "params": []
                }
              ]
            },
            {
              "textRaw": "performance.clearMarks([name])",
              "type": "method",
              "name": "clearMarks",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string} ",
                      "name": "name",
                      "type": "string",
                      "optional": true
                    }
                  ]
                },
                {
                  "params": [
                    {
                      "name": "name",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>If <code>name</code> is not provided, removes all <code>PerformanceMark</code> objects from the\nPerformance Timeline. If <code>name</code> is provided, removes only the named mark.</p>\n"
            },
            {
              "textRaw": "performance.clearMeasures([name])",
              "type": "method",
              "name": "clearMeasures",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string} ",
                      "name": "name",
                      "type": "string",
                      "optional": true
                    }
                  ]
                },
                {
                  "params": [
                    {
                      "name": "name",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>If <code>name</code> is not provided, removes all <code>PerformanceMeasure</code> objects from the\nPerformance Timeline. If <code>name</code> is provided, removes only objects whose\n<code>performanceEntry.name</code> matches <code>name</code>.</p>\n"
            },
            {
              "textRaw": "performance.getEntries()",
              "type": "method",
              "name": "getEntries",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Array} ",
                    "name": "return",
                    "type": "Array"
                  },
                  "params": []
                },
                {
                  "params": []
                }
              ],
              "desc": "<p>Returns a list of all <code>PerformanceEntry</code> objects in chronological order\nwith respect to <code>performanceEntry.startTime</code>.</p>\n"
            },
            {
              "textRaw": "performance.getEntriesByName(name[, type])",
              "type": "method",
              "name": "getEntriesByName",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Array} ",
                    "name": "return",
                    "type": "Array"
                  },
                  "params": [
                    {
                      "textRaw": "`name` {string} ",
                      "name": "name",
                      "type": "string"
                    },
                    {
                      "textRaw": "`type` {string} ",
                      "name": "type",
                      "type": "string",
                      "optional": true
                    }
                  ]
                },
                {
                  "params": [
                    {
                      "name": "name"
                    },
                    {
                      "name": "type",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Returns a list of all <code>PerformanceEntry</code> objects in chronological order\nwith respect to <code>performanceEntry.startTime</code> whose <code>performanceEntry.name</code> is\nequal to <code>name</code>, and optionally, whose <code>performanceEntry.entryType</code> is equal to\n<code>type</code>.</p>\n"
            },
            {
              "textRaw": "performance.getEntriesByType(type)",
              "type": "method",
              "name": "getEntriesByType",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {Array} ",
                    "name": "return",
                    "type": "Array"
                  },
                  "params": [
                    {
                      "textRaw": "`type` {string} ",
                      "name": "type",
                      "type": "string"
                    }
                  ]
                },
                {
                  "params": [
                    {
                      "name": "type"
                    }
                  ]
                }
              ],
              "desc": "<p>Returns a list of all <code>PerformanceEntry</code> objects in chronological order\nwith respect to <code>performanceEntry.startTime</code> whose <code>performanceEntry.entryType</code>\nis equal to <code>type</code>.</p>\n"
            },
            {
              "textRaw": "performance.mark([name])",
              "type": "method",
              "name": "mark",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string} ",
                      "name": "name",
                      "type": "string",
                      "optional": true
                    }
                  ]
                },
                {
                  "params": [
                    {
                      "name": "name",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Creates a new <code>PerformanceMark</code> entry in the Performance Timeline. A\n<code>PerformanceMark</code> is a subclass of <code>PerformanceEntry</code> whose\n<code>performanceEntry.entryType</code> is always <code>&#39;mark&#39;</code>, and whose\n<code>performanceEntry.duration</code> is always <code>0</code>. Performance marks are used\nto mark specific significant moments in the Performance Timeline.</p>\n"
            },
            {
              "textRaw": "performance.measure(name, startMark, endMark)",
              "type": "method",
              "name": "measure",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string} ",
                      "name": "name",
                      "type": "string"
                    },
                    {
                      "textRaw": "`startMark` {string} ",
                      "name": "startMark",
                      "type": "string"
                    },
                    {
                      "textRaw": "`endMark` {string} ",
                      "name": "endMark",
                      "type": "string"
                    }
                  ]
                },
                {
                  "params": [
                    {
                      "name": "name"
                    },
                    {
                      "name": "startMark"
                    },
                    {
                      "name": "endMark"
                    }
                  ]
                }
              ],
              "desc": "<p>Creates a new <code>PerformanceMeasure</code> entry in the Performance Timeline. A\n<code>PerformanceMeasure</code> is a subclass of <code>PerformanceEntry</code> whose\n<code>performanceEntry.entryType</code> is always <code>&#39;measure&#39;</code>, and whose\n<code>performanceEntry.duration</code> measures the number of milliseconds elapsed since\n<code>startMark</code> and <code>endMark</code>.</p>\n<p>The <code>startMark</code> argument may identify any <em>existing</em> <code>PerformanceMark</code> in the\nPerformance Timeline, or <em>may</em> identify any of the timestamp properties\nprovided by the <code>PerformanceNodeTiming</code> class. If the named <code>startMark</code> does\nnot exist, then <code>startMark</code> is set to <a href=\"https://w3c.github.io/hr-time/#dom-performance-timeorigin\"><code>timeOrigin</code></a> by default.</p>\n<p>The <code>endMark</code> argument must identify any <em>existing</em> <code>PerformanceMark</code> in the\nPerformance Timeline or any of the timestamp properties provided by the\n<code>PerformanceNodeTiming</code> class. If the named <code>endMark</code> does not exist, an\nerror will be thrown.</p>\n"
            },
            {
              "textRaw": "performance.now()",
              "type": "method",
              "name": "now",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "return": {
                    "textRaw": "Returns: {number} ",
                    "name": "return",
                    "type": "number"
                  },
                  "params": []
                },
                {
                  "params": []
                }
              ],
              "desc": "<p>Returns the current high resolution millisecond timestamp.</p>\n"
            },
            {
              "textRaw": "performance.timerify(fn)",
              "type": "method",
              "name": "timerify",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fn` {Function} ",
                      "name": "fn",
                      "type": "Function"
                    }
                  ]
                },
                {
                  "params": [
                    {
                      "name": "fn"
                    }
                  ]
                }
              ],
              "desc": "<p>Wraps a function within a new function that measures the running time of the\nwrapped function. A <code>PerformanceObserver</code> must be subscribed to the <code>&#39;function&#39;</code>\nevent type in order for the timing details to be accessed.</p>\n<pre><code class=\"lang-js\">const {\n  performance,\n  PerformanceObserver\n} = require(&#39;perf_hooks&#39;);\n\nfunction someFunction() {\n  console.log(&#39;hello world&#39;);\n}\n\nconst wrapped = performance.timerify(someFunction);\n\nconst obs = new PerformanceObserver((list) =&gt; {\n  console.log(list.getEntries()[0].duration);\n  obs.disconnect();\n  performance.clearFunctions();\n});\nobs.observe({ entryTypes: [&#39;function&#39;] });\n\n// A performance timeline entry will be created\nwrapped();\n</code></pre>\n"
            }
          ],
          "properties": [
            {
              "textRaw": "performance.maxEntries",
              "name": "maxEntries",
              "meta": {
                "added": [
                  "v9.6.0"
                ],
                "changes": []
              },
              "desc": "<p>Value: {number}</p>\n<p>The maximum number of Performance Entry items that should be added to the\nPerformance Timeline. This limit is not strictly enforced, but a process\nwarning will be emitted if the number of entries in the timeline exceeds\nthis limit.</p>\n<p>Defaults to 150.</p>\n"
            },
            {
              "textRaw": "`nodeTiming` {PerformanceNodeTiming} ",
              "type": "PerformanceNodeTiming",
              "name": "nodeTiming",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>An instance of the <code>PerformanceNodeTiming</code> class that provides performance\nmetrics for specific Node.js operational milestones.</p>\n"
            },
            {
              "textRaw": "`timeOrigin` {number} ",
              "type": "number",
              "name": "timeOrigin",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The <a href=\"https://w3c.github.io/hr-time/#dom-performance-timeorigin\"><code>timeOrigin</code></a> specifies the high resolution millisecond timestamp from\nwhich all performance metric durations are measured.</p>\n"
            }
          ]
        },
        {
          "textRaw": "Class: PerformanceEntry",
          "type": "class",
          "name": "PerformanceEntry",
          "meta": {
            "added": [
              "v8.5.0"
            ],
            "changes": []
          },
          "properties": [
            {
              "textRaw": "`duration` {number} ",
              "type": "number",
              "name": "duration",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The total number of milliseconds elapsed for this entry. This value will not\nbe meaningful for all Performance Entry types.</p>\n"
            },
            {
              "textRaw": "`name` {string} ",
              "type": "string",
              "name": "name",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The name of the performance entry.</p>\n"
            },
            {
              "textRaw": "`startTime` {number} ",
              "type": "number",
              "name": "startTime",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The high resolution millisecond timestamp marking the starting time of the\nPerformance Entry.</p>\n"
            },
            {
              "textRaw": "`entryType` {string} ",
              "type": "string",
              "name": "entryType",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The type of the performance entry. Current it may be one of: <code>&#39;node&#39;</code>, <code>&#39;mark&#39;</code>,\n<code>&#39;measure&#39;</code>, <code>&#39;gc&#39;</code>, or <code>&#39;function&#39;</code>.</p>\n"
            },
            {
              "textRaw": "`kind` {number} ",
              "type": "number",
              "name": "kind",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>When <code>performanceEntry.entryType</code> is equal to <code>&#39;gc&#39;</code>, the <code>performance.kind</code>\nproperty identifies the type of garbage collection operation that occurred.\nThe value may be one of:</p>\n<ul>\n<li><code>perf_hooks.constants.NODE_PERFORMANCE_GC_MAJOR</code></li>\n<li><code>perf_hooks.constants.NODE_PERFORMANCE_GC_MINOR</code></li>\n<li><code>perf_hooks.constants.NODE_PERFORMANCE_GC_INCREMENTAL</code></li>\n<li><code>perf_hooks.constants.NODE_PERFORMANCE_GC_WEAKCB</code></li>\n</ul>\n"
            }
          ]
        },
        {
          "textRaw": "Class: PerformanceNodeTiming extends PerformanceEntry",
          "type": "class",
          "name": "PerformanceNodeTiming",
          "meta": {
            "added": [
              "v8.5.0"
            ],
            "changes": []
          },
          "desc": "<p>Provides timing details for Node.js itself.</p>\n",
          "properties": [
            {
              "textRaw": "`bootstrapComplete` {number} ",
              "type": "number",
              "name": "bootstrapComplete",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The high resolution millisecond timestamp at which the Node.js process\ncompleted bootstrap.</p>\n"
            },
            {
              "textRaw": "`clusterSetupEnd` {number} ",
              "type": "number",
              "name": "clusterSetupEnd",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The high resolution millisecond timestamp at which cluster processing ended.</p>\n"
            },
            {
              "textRaw": "`clusterSetupStart` {number} ",
              "type": "number",
              "name": "clusterSetupStart",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The high resolution millisecond timestamp at which cluster processing started.</p>\n"
            },
            {
              "textRaw": "`loopExit` {number} ",
              "type": "number",
              "name": "loopExit",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The high resolution millisecond timestamp at which the Node.js event loop\nexited.</p>\n"
            },
            {
              "textRaw": "`loopStart` {number} ",
              "type": "number",
              "name": "loopStart",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The high resolution millisecond timestamp at which the Node.js event loop\nstarted.</p>\n"
            },
            {
              "textRaw": "`moduleLoadEnd` {number} ",
              "type": "number",
              "name": "moduleLoadEnd",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The high resolution millisecond timestamp at which main module load ended.</p>\n"
            },
            {
              "textRaw": "`moduleLoadStart` {number} ",
              "type": "number",
              "name": "moduleLoadStart",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The high resolution millisecond timestamp at which main module load started.</p>\n"
            },
            {
              "textRaw": "`nodeStart` {number} ",
              "type": "number",
              "name": "nodeStart",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The high resolution millisecond timestamp at which the Node.js process was\ninitialized.</p>\n"
            },
            {
              "textRaw": "`preloadModuleLoadEnd` {number} ",
              "type": "number",
              "name": "preloadModuleLoadEnd",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The high resolution millisecond timestamp at which preload module load ended.</p>\n"
            },
            {
              "textRaw": "`preloadModuleLoadStart` {number} ",
              "type": "number",
              "name": "preloadModuleLoadStart",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The high resolution millisecond timestamp at which preload module load started.</p>\n"
            },
            {
              "textRaw": "`thirdPartyMainEnd` {number} ",
              "type": "number",
              "name": "thirdPartyMainEnd",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The high resolution millisecond timestamp at which third_party_main processing\nended.</p>\n"
            },
            {
              "textRaw": "`thirdPartyMainStart` {number} ",
              "type": "number",
              "name": "thirdPartyMainStart",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The high resolution millisecond timestamp at which third_party_main processing\nstarted.</p>\n"
            },
            {
              "textRaw": "`v8Start` {number} ",
              "type": "number",
              "name": "v8Start",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The high resolution millisecond timestamp at which the V8 platform was\ninitialized.</p>\n"
            }
          ]
        },
        {
          "textRaw": "Class: PerformanceObserver(callback)",
          "type": "class",
          "name": "PerformanceObserver(callback)",
          "meta": {
            "added": [
              "v8.5.0"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li><code>callback</code> {Function} A <code>PerformanceObserverCallback</code> callback function.</li>\n</ul>\n<p><code>PerformanceObserver</code> objects provide notifications when new\n<code>PerformanceEntry</code> instances have been added to the Performance Timeline.</p>\n<pre><code class=\"lang-js\">const {\n  performance,\n  PerformanceObserver\n} = require(&#39;perf_hooks&#39;);\n\nconst obs = new PerformanceObserver((list, observer) =&gt; {\n  console.log(list.getEntries());\n  observer.disconnect();\n});\nobs.observe({ entryTypes: [&#39;mark&#39;], buffered: true });\n\nperformance.mark(&#39;test&#39;);\n</code></pre>\n<p>Because <code>PerformanceObserver</code> instances introduce their own additional\nperformance overhead, instances should not be left subscribed to notifications\nindefinitely. Users should disconnect observers as soon as they are no\nlonger needed.</p>\n",
          "modules": [
            {
              "textRaw": "Callback: PerformanceObserverCallback(list, observer)",
              "name": "callback:_performanceobservercallback(list,_observer)",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li><code>list</code> {PerformanceObserverEntryList}</li>\n<li><code>observer</code> {PerformanceObserver}</li>\n</ul>\n<p>The <code>PerformanceObserverCallback</code> is invoked when a <code>PerformanceObserver</code> is\nnotified about new <code>PerformanceEntry</code> instances. The callback receives a\n<code>PerformanceObserverEntryList</code> instance and a reference to the\n<code>PerformanceObserver</code>.</p>\n",
              "type": "module",
              "displayName": "Callback: PerformanceObserverCallback(list, observer)"
            },
            {
              "textRaw": "Measuring the duration of async operations",
              "name": "measuring_the_duration_of_async_operations",
              "desc": "<p>The following example uses the <a href=\"async_hooks.html\">Async Hooks</a> and Performance APIs to measure\nthe actual duration of a Timeout operation (including the amount of time it\nto execute the callback).</p>\n<pre><code class=\"lang-js\">&#39;use strict&#39;;\nconst async_hooks = require(&#39;async_hooks&#39;);\nconst {\n  performance,\n  PerformanceObserver\n} = require(&#39;perf_hooks&#39;);\n\nconst set = new Set();\nconst hook = async_hooks.createHook({\n  init(id, type) {\n    if (type === &#39;Timeout&#39;) {\n      performance.mark(`Timeout-${id}-Init`);\n      set.add(id);\n    }\n  },\n  destroy(id) {\n    if (set.has(id)) {\n      set.delete(id);\n      performance.mark(`Timeout-${id}-Destroy`);\n      performance.measure(`Timeout-${id}`,\n                          `Timeout-${id}-Init`,\n                          `Timeout-${id}-Destroy`);\n    }\n  }\n});\nhook.enable();\n\nconst obs = new PerformanceObserver((list, observer) =&gt; {\n  console.log(list.getEntries()[0]);\n  performance.clearMarks();\n  performance.clearMeasures();\n  observer.disconnect();\n});\nobs.observe({ entryTypes: [&#39;measure&#39;], buffered: true });\n\nsetTimeout(() =&gt; {}, 1000);\n</code></pre>\n",
              "type": "module",
              "displayName": "Measuring the duration of async operations"
            },
            {
              "textRaw": "Measuring how long it takes to load dependencies",
              "name": "measuring_how_long_it_takes_to_load_dependencies",
              "desc": "<p>The following example measures the duration of <code>require()</code> operations to load\ndependencies:</p>\n<!-- eslint-disable no-global-assign -->\n<pre><code class=\"lang-js\">&#39;use strict&#39;;\nconst {\n  performance,\n  PerformanceObserver\n} = require(&#39;perf_hooks&#39;);\nconst mod = require(&#39;module&#39;);\n\n// Monkey patch the require function\nmod.Module.prototype.require =\n  performance.timerify(mod.Module.prototype.require);\nrequire = performance.timerify(require);\n\n// Activate the observer\nconst obs = new PerformanceObserver((list) =&gt; {\n  const entries = list.getEntries();\n  entries.forEach((entry) =&gt; {\n    console.log(`require(&#39;${entry[0]}&#39;)`, entry.duration);\n  });\n  obs.disconnect();\n  // Free memory\n  performance.clearFunctions();\n});\nobs.observe({ entryTypes: [&#39;function&#39;], buffered: true });\n\nrequire(&#39;some-module&#39;);\n</code></pre>\n",
              "type": "module",
              "displayName": "Measuring how long it takes to load dependencies"
            }
          ],
          "classes": [
            {
              "textRaw": "Class: PerformanceObserverEntryList",
              "type": "class",
              "name": "PerformanceObserverEntryList",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The <code>PerformanceObserverEntryList</code> class is used to provide access to the\n<code>PerformanceEntry</code> instances passed to a <code>PerformanceObserver</code>.</p>\n",
              "methods": [
                {
                  "textRaw": "performanceObserverEntryList.getEntries()",
                  "type": "method",
                  "name": "getEntries",
                  "meta": {
                    "added": [
                      "v8.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {Array} ",
                        "name": "return",
                        "type": "Array"
                      },
                      "params": []
                    },
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Returns a list of <code>PerformanceEntry</code> objects in chronological order\nwith respect to <code>performanceEntry.startTime</code>.</p>\n"
                },
                {
                  "textRaw": "performanceObserverEntryList.getEntriesByName(name[, type])",
                  "type": "method",
                  "name": "getEntriesByName",
                  "meta": {
                    "added": [
                      "v8.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {Array} ",
                        "name": "return",
                        "type": "Array"
                      },
                      "params": [
                        {
                          "textRaw": "`name` {string} ",
                          "name": "name",
                          "type": "string"
                        },
                        {
                          "textRaw": "`type` {string} ",
                          "name": "type",
                          "type": "string",
                          "optional": true
                        }
                      ]
                    },
                    {
                      "params": [
                        {
                          "name": "name"
                        },
                        {
                          "name": "type",
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Returns a list of <code>PerformanceEntry</code> objects in chronological order\nwith respect to <code>performanceEntry.startTime</code> whose <code>performanceEntry.name</code> is\nequal to <code>name</code>, and optionally, whose <code>performanceEntry.entryType</code> is equal to\n<code>type</code>.</p>\n"
                },
                {
                  "textRaw": "performanceObserverEntryList.getEntriesByType(type)",
                  "type": "method",
                  "name": "getEntriesByType",
                  "meta": {
                    "added": [
                      "v8.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "return": {
                        "textRaw": "Returns: {Array} ",
                        "name": "return",
                        "type": "Array"
                      },
                      "params": [
                        {
                          "textRaw": "`type` {string} ",
                          "name": "type",
                          "type": "string"
                        }
                      ]
                    },
                    {
                      "params": [
                        {
                          "name": "type"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Returns a list of <code>PerformanceEntry</code> objects in chronological order\nwith respect to <code>performanceEntry.startTime</code> whose <code>performanceEntry.entryType</code>\nis equal to <code>type</code>.</p>\n"
                }
              ]
            }
          ],
          "methods": [
            {
              "textRaw": "performanceObserver.disconnect()",
              "type": "method",
              "name": "disconnect",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>Disconnects the <code>PerformanceObserver</code> instance from all notifications.</p>\n",
              "signatures": [
                {
                  "params": []
                }
              ]
            },
            {
              "textRaw": "performanceObserver.observe(options)",
              "type": "method",
              "name": "observe",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object} ",
                      "options": [
                        {
                          "textRaw": "`entryTypes` {Array} An array of strings identifying the types of `PerformanceEntry` instances the observer is interested in. If not provided an error will be thrown. ",
                          "name": "entryTypes",
                          "type": "Array",
                          "desc": "An array of strings identifying the types of `PerformanceEntry` instances the observer is interested in. If not provided an error will be thrown."
                        },
                        {
                          "textRaw": "`buffered` {boolean} If true, the notification callback will be called using `setImmediate()` and multiple `PerformanceEntry` instance notifications will be buffered internally. If `false`, notifications will be immediate and synchronous. Defaults to `false`. ",
                          "name": "buffered",
                          "type": "boolean",
                          "desc": "If true, the notification callback will be called using `setImmediate()` and multiple `PerformanceEntry` instance notifications will be buffered internally. If `false`, notifications will be immediate and synchronous. Defaults to `false`."
                        }
                      ],
                      "name": "options",
                      "type": "Object"
                    }
                  ]
                },
                {
                  "params": [
                    {
                      "name": "options"
                    }
                  ]
                }
              ],
              "desc": "<p>Subscribes the <code>PerformanceObserver</code> instance to notifications of new\n<code>PerformanceEntry</code> instances identified by <code>options.entryTypes</code>.</p>\n<p>When <code>options.buffered</code> is <code>false</code>, the <code>callback</code> will be invoked once for\nevery <code>PerformanceEntry</code> instance:</p>\n<pre><code class=\"lang-js\">const {\n  performance,\n  PerformanceObserver\n} = require(&#39;perf_hooks&#39;);\n\nconst obs = new PerformanceObserver((list, observer) =&gt; {\n  // called three times synchronously. list contains one item\n});\nobs.observe({ entryTypes: [&#39;mark&#39;] });\n\nfor (let n = 0; n &lt; 3; n++)\n  performance.mark(`test${n}`);\n</code></pre>\n<pre><code class=\"lang-js\">const {\n  performance,\n  PerformanceObserver\n} = require(&#39;perf_hooks&#39;);\n\nconst obs = new PerformanceObserver((list, observer) =&gt; {\n  // called once. list contains three items\n});\nobs.observe({ entryTypes: [&#39;mark&#39;], buffered: true });\n\nfor (let n = 0; n &lt; 3; n++)\n  performance.mark(`test${n}`);\n</code></pre>\n<h2>Examples</h2>\n"
            }
          ]
        }
      ],
      "type": "module",
      "displayName": "Performance Timing API"
    }
  ]
}
