469,286 Members | 2,442 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,286 developers. It's quick & easy.

Get CPU usage of a single process in Windows

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
3 2703
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
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
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.

Similar topics

reply views Thread by KenH | last post: by
3 posts views Thread by Dan | last post: by
15 posts views Thread by Dirk Reske | last post: by
11 posts views Thread by Paulo Eduardo | last post: by
1 post views Thread by Damien | last post: by
17 posts views Thread by Frank Rizzo | last post: by
reply views Thread by =?Utf-8?B?SkhhbGV5?= | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.