Solved

How do I programmatically find the CPU usage of another process in Windows NT & W2K?

Posted on 2001-08-10
9
203 Views
Last Modified: 2013-12-03
How do I programmatically find the CPU usage of another process in Windows NT & W2K?
I want to delay my processing based on the CPU taken by a co-process. Both the processes are COM services.
Wondering how the Windows Task Manager or performance Manger does it!


0
Comment
Question by:Sanjoo
  • 3
  • 2
  • 2
  • +1
9 Comments
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 6378662
0
 

Author Comment

by:Sanjoo
ID: 6378688
Thanx, but..
I wanted to find the CPU usage of 'a particular process' at the current time and not the total CPU usage at the current time.(in Win NT & W2K) The CPU is of the Intel family of processors.

PS> I already have the Codepile.com stuff with me but it gives the total CPU usage only.

0
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 6384598
Or, you want for every thread. In such case see
http://www.edm2.com/0607/cpu.html
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
LVL 14

Accepted Solution

by:
AlexVirochovsky earned 50 total points
ID: 6417791
I hope, code from my comment helps. Alex
0
 

Author Comment

by:Sanjoo
ID: 6418160
That solution is only for OS/2 Warp I guess as the article goes. I wanted one that works for WinNT 4.0 and Win2K both!
I guess I mentioned it.

The article talks of only OS/2 Warp 3.0 and 4.0 nothing Microsoft about it!

Moreover I cannot use undocumented features in windows for the fear of future compatibilty.

Also, I am nearing on another different solution here, hopefully it should be over this week.

Thanks.
0
 
LVL 3

Expert Comment

by:Melange
ID: 6666462
The information you want is in the performance counters of the system. There are API functions for reading this. Unfortunately they're not the most intuitive. There were some articles using performance counters recently in MSDN/MSJ magazine. Try searching the knowledge base at http://msdn.microsoft.com for information on reading performance counters. Incidentally you can also create your own counters if you have the need.

I'm sorry this isn't much help, but I haven't had the need yet to do this myself, so I don't know the specifics. But at least this should point you in the right direction.
0
 
LVL 3

Expert Comment

by:Melange
ID: 6666476
Come to think of it, the articles I was thinking of were in Windows Developers Journal, but here are some similar articles from MSJ:

Part 1: general and for VB
http://www.microsoft.com/msj/defaultframe.asp?page=/msj/0398/hood0398.htm

and

Part 2: more specifics and for C/C++
http://www.microsoft.com/msj/defaultframe.asp?page=/msj/0598/hood0598.htm
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6697018
If this proposed answer has helped you, please accept it, grade it and close this question.  If it is not, reject it and add comments as to your progress and what else is needed.

Thanks,
Moondancer
Community Support Moderator @ Experts Exchange
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6791209
Zero response from Asker or expert(s) since my last follow up request, therefore can only assume that the Proposed Answer served the need.  Closing today.

I am sorry to see that Asker has not returned to update and finalize this question.  I am, therefore, force accepting this question.  In the event the Asker returns with additional needs related to this question, please respond and continue the collaboration process.
 
If there are questions in this regard, please comment and I'll return when I can.
 
The HELP DESK link on the left is informative, and includes this site's Guidelines and Member Agreement as well as assistance related to Questions and Answers.  Here is the QA link, as a reference.
 
http://www.experts-exchange.com/jsp/cmtyQuestAnswer.jsp

--->  While I'm here anyway, letting all know that we have added quite a number of new Topic Areas, as you'll see from the link below:

http://www.experts-exchange.com/jsp/zonesAll.jsp
 
Thank you,
Moondancer
Community Support Moderator @ Experts Exchange
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question