0

Using Chrome Developer Tools Profiling, I profiled both Javascript and CSS.

For JS, it shows Javascript functions and Total %. For CSS, it shows Selector and Total %.

If I understand correctly, the operating system gives some chunk of CPU to the browser.

Then, the Developer Tools Profiling tool gives the % of CPU that each function and/or selector uses.

Is that right?

4

1 回答 1

3

The Total % is the percentage of the total profile time that a particular entry has contributed. This may or may not be equal to the total profiling time (i.e., the time between clicks of the Start/Stop button.) Profile time only counts the time that the profiled code was executed.

Example: your CSS profiling time is 1s (you clicked Start, waited for 1s, and clicked Stop). Your CSS profile time is 200ms (that is, it took your browser only 200ms to match and apply all selectors to the right DOM elements). The * selector's Total % is 12% (that is, handling the * selector took your browser 24ms).

You can click the % button in the status bar at the bottom to see the absolute times instead of percentages.

于 2012-12-04T10:05:28.297 回答