Link to home
Start Free TrialLog in
Avatar of chicago84
chicago84

asked on

Identify CPU % in use within Visual Basic

Is there a function or methodology to check the percentage of CPU currently being used in Visual Basic?  VB version 6.0.  Thanks.

Avatar of ethrbunny
ethrbunny

tracking CPU usage involves working with performance monitoring and a specific sub-section of the registry. I don't think there is a specific way to do this via VB but rather you'd have to use the Win32 method and import all the neccesary functions.

As an example look in MSDN at article Q194655. This is about tracking mem leaks but shows you the process for examining performance data.
I agree with ethrbunny, this involve querying the registry. Try this example:

http://www.freevbcode.com/code/CPUTester.zip
Avatar of chicago84

ASKER

Thanks for the tips.  We found a way to use the system monitor component which is associated with the activeX add-in within Visual Basic.

can you post the activex name ? after you do that also write to the community support to refund your points and add the question to PAQ?
Thanks
We used the System Monitor Control ActiveX component associated with VB.  After some searching we found this simple control that allows a program to moniter the various aspects of a computers memory in much the same way as the task manager does.  We found that this is far easier than accessing the system registry.  
ok its the syssmon.ocx located in the system dir.
chicago84: can you please write to the community support to refund your points and paq this question? thanks
refund your points and paq this question

Bhagyesh Trivedi
ASKER CERTIFIED SOLUTION
Avatar of ee_ai_construct
ee_ai_construct
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial