I have a Python application, running on Windows, that is somewhat CPU-intensive, and I'm trying to figure out the impact of some of my design choices.
Is there a way to measure CPU utilization for a particular process over a designated time period, both for total CPU, and on a per core basis? (per-core is important since Python's GIL prevents this program from using more than one core to any major extent, therefore for my 8-core PC, a CPU load of "only" 12% nearly maxes out one core)
I have Sysinternals Process Explorer, and it shows total CPU usage in 1-second intervals:
but the CPU usage bounces up and down, so I would like to use a longer measuring interval, essentially following this process:
- start my Python application
- configure my application (it has a UI) to run in a certain way
- measure CPU usage over a moderately long interval (10-60 seconds)
- configure my application in a different way
- measure CPU usage over a moderately long interval (10-60 seconds)
- repeat for additional configurations as needed