By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,672 Members | 1,628 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,672 IT Pros & Developers. It's quick & easy.

Get CPU usage of a single process in Windows

P: n/a
Hi,

This should be possible as Taskmanager tracks CPU usage for every
process... Anyone know how this can be done?

regards
Sep 8 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Tor Erik wrote:
Hi,

This should be possible as Taskmanager tracks CPU usage for every
process... Anyone know how this can be done?
WMI can probably do the trick. If you can find something on Google
for wmi cpu usage (or something similar) then translation to Python's
usually quite easy. I'm fairly sure I've got an example somewhere, but
I can't lay my hands on it at the mo.

TJG

Sep 8 '06 #2

P: n/a
Tor Erik <to*******@gmail.comwrote:
>
This should be possible as Taskmanager tracks CPU usage for every
process... Anyone know how this can be done?
I answered this in the python-win32 mailing list. Task manager and perfmon
do this by using the performance counter APIs. Python-Win32 includes an
interface for that (import win32pdh), but I've never used it.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Sep 9 '06 #3

P: n/a
Tim Golden wrote:
<...snip...>
>>This should be possible as Taskmanager tracks CPU usage for every
process... Anyone know how this can be done?

WMI can probably do the trick. If you can find something on Google
for wmi cpu usage (or something similar) then translation to Python's
usually quite easy. I'm fairly sure I've got an example somewhere, but
I can't lay my hands on it at the mo.

TJG
Tim Golden's general documentation/examples about WMI are at:
<http://tgolden.sc.sabren.com/python/wmi.html>.

If you have a working example of CPU usage could you post the result? I
would be interested.

kind regards, Gerrit Muller

--
Gaudi systems architecting:
<http://www.gaudisite.nl/>
Sep 12 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.