Getting CPU speed

Is there a standard API for retrieving the machine CPU speed ?
I know the info is in the registry:
HKEY_LOCAL_MACHINEHARDWARE\DESCRIPTION\System\CentralProcessor\0

I'm curious if there is a stanard way to get it.

thanks,
Avi.


kavasAsked:
Who is Participating?
 
chensuConnect With a Mentor Commented:
>Is there a standard API for retrieving the machine CPU speed ?

There is no Win32 API function to do what you want. The closest is the GetSystemInfo function.
0
 
chensuCommented:
0
 
kavasAuthor Commented:
Sorry,
Looking for a standard API call, not a library.
If you were wondering, I'm comparing API's of a few OS as a part of my research.

thanks,
Avi.
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
ntdragonCommented:
you mean in by programring

try c++builder there are some system components that will get it for you

or if you want it for dos as well take a comp that you know it's speed then make a loop and check how much time did it take for the comp to pass the loop then you can do it on any comp and colculate the comp speed
0
 
kavasAuthor Commented:
1. I'm working with VC++ 6.0
2. Still looking for a WIN32 call.
3. Why not using HKEY_LOCAL_MACHINEHARDWARE\DESCRIPTION\System\CentralProcessor\0

Avi.


0
 
kavasAuthor Commented:
Do you know when: HKEY_LOCAL_MACHINEHARDWARE\DESCRIPTION\System\CentralProcessor\0

is calculated and how accurate it is ?
0
 
chensuCommented:
I think that registry value is written when Windows is installed or there is any change to the CPU. The value is not 100% accurate.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.