472,374 Members | 1,378 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,374 software developers and data experts.

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 2805
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: KenH | last post by:
I have a MDI C# Windows form application that increases its memory usage about 4k every second - even with all of the child windows closed. I have seen other posts about similar problems,...
3
by: Dan | last post by:
First, I'm sorry if this question has been asked too many times. I'm new to this news group. The question has to do with the use of popup windows in a web page. I have heard that popup windows...
15
by: Dirk Reske | last post by:
Hello, why doesn't this code work correctly? private int GetCpuUsage(Process proc) { DateTime time1,time2; TimeSpan timediff; double cpu1,cpu2,cpudiff;
11
by: Paulo Eduardo | last post by:
Hi, All! We are developing one app for windows 95/98/Me/NT4.0/2000/XP/2003 using Visual C++ 6.0. We need to set the % of CPU Usage to app process. Is there an API to set % of CPU Usage? Can...
4
by: AN | last post by:
Greetings, We make an ASP.NET web application and we host it for our customers. We have provisioned hardware and hope to be able to service around 200 customers on this hardware. The web...
1
by: Damien | last post by:
Hi guys, I'm looking for ideas for troubleshooting the following. We've tried some random things to try to treat the symptoms, but none seem robust enough to use when we go live, and we'd rather...
17
by: Frank Rizzo | last post by:
Hello, I've compiled my app for AnyCPU setting in vs2005. Then I tried the app on both 32-bit Windows 2003 R2 and 64-bit Windows 2003 R2. The memory usage of the application when working on...
0
by: =?Utf-8?B?SkhhbGV5?= | last post by:
Our system is: IIS Server: dual Intel Xeon 2.80 GHz, 4 GB Ram Windows Server 2003 SP2 IIS 6.0 SQL Server: dual Intel Xeon 2.80 GHz, 4 GB Ram (separate server) Windows Server 2003 SP2 SQL...
3
by: dittytwo | last post by:
Hi all I have been looking around the web and can't seem to find a solution the solution that i have found and manipulated seems to bring back the whole list of currently running process's...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...
0
by: F22F35 | last post by:
I am a newbie to Access (most programming for that matter). I need help in creating an Access database that keeps the history of each user in a database. For example, a user might have lesson 1 sent...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.