| || |
CPU usage question
I have a question on how to find CPU usage by an application.
The problem that I'm having right now is that my AUT is running VERY sluggish and after each click, it consumes 100% of CPU for a variable amounts of time. Because that is happening, my scripts are failing with "window not found" or something like that.
I don't want to set timers after each call. So, I want to write a function that will tell me how much CPU is a process (with a certain PID) is currently using. The function will essentially be an infinite loop... something like this:
<font class="small">Code:</font><hr /><pre>
while ((cpu > 10%) && (application is still running))
I'm sure that has to be some sort of windows api or maybe some other creative way of doing this...
Any help would be appreciated!
Re: CPU usage question
I have solved this problem and shared solution code here:
CPU Times Solution