Search code examples
google-chrome-devtoolsperformance-testingdevtools

When does "Start profiling and reload page" decide to stop the automatic recording?


I often use the Performance Timeline in Chrome DevTools to record my page performance.

I use "Start profiling and reload page", which automatically starts and stops the recording.

The question is: When does DevTools decide to stop the recording?

I've noticed that it always continues to record at least a few hundred ms past the "Load"-event and tries to figure out when the page has gone "mostly idle".

But that's quite a fuzzy guess. I'd love to know if it relies on some performance event (like the one used in "time to interactive" in Lighthouse)?


Solution

  • Chrome devtools waits for 5 seconds after load event (source) since Chrome 85. This is not documented so it may change without notice and did change in Chrome 85 from 3 seconds.

    You can modify this behavior in your current debugging session:

    1. switch devtools to Performance panel/tab
    2. open devtools-on-devtools and run the following code in its console:
    UI.panels.timeline.millisecondsToRecordAfterLoadEvent = 9001.