Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using performance.mark() with Chrome dev tools performance tab

Tags:

I'd like to see my calls to performance.mark(...) show up on Chrome's dev tools Performance tab. All the documentation I can find online seem to refer to the no longer existing "Timeline" tab, while the docs on the new Performance tab don't have anything to say about it.

In my code, I'm simply doing performance.mark('my mark name'). I have also tried doing the same with console.timeStamp('my mark name') because I saw that in some old docs as well.

How do I see these calls to performance.mark() on the Performance tab?

like image 340
maxedison Avatar asked Oct 11 '17 16:10

maxedison


People also ask

How do I use the Performance tab in Chrome dev tools?

To access the Performance tab, navigate to the website you want to profile, then open Chrome DevTools by right-clicking and selecting Inspect. Select the Performance tab inside Chrome DevTools. The easiest way to capture a performance profile is by clicking the Start profiling and reload page icon.

How do I throttle my CPU in Chrome?

Open Chrome Canary or Developer and enter chrome://flags/#quick-intensive-throttling-after-loading in the address bar, as shown below. Set the 'Quick intensive throttling after loading' flag to Enabled and relaunch Chrome when prompted.

What is scripting time in Chrome performance?

To be able to visually identify what was going on when you profiled your website, Timeline is painted in different colors. JavaScript execution time is marked in yellow and it's called Scripting. The purple area shows the Rendering and the green parts of the Timeline show the Painting process.


1 Answers

In the new performance tab markers show up in "User Timing". You need to use

performance.measure()

to mark the start and end of your marks like this:

performance.mark('myMark-start');

// your code 

performance.mark('myMark-end');
performance.measure('myPerfMarker', 'myMark-start', 'myMark-end');
like image 81
aliry Avatar answered Sep 28 '22 04:09

aliry