Archived

This topic is now archived and is closed to further replies.

HellRaiZer

Cpu Information Questions

Recommended Posts

I would like to ask a question about how to get cpu informations. I found in MSDN how to get informations about the operating system with the GetVersionEx() function, and how to get info about the system with the GetSystemInfo(). But i can''t find a function on how to get info such as the name of the cpu and the Mhz. In the .NET MSDN i found a tutorial that with assembly you can take info about the cpu such as family,Stepping,... but there is no info about the Mhz of the Cpu. Does anyone know how to find the Cpu Mhz? Please Answer. Thanks in advance.

Share this post


Link to post
Share on other sites
Right-click my computer in win XP, go to properties. It''s in the lower right hand corner.

*ducks*

Share this post


Link to post
Share on other sites
I know that thing. The question was about how to do it with code in C or assembly. Is there a way. How the windows do it and retrieve infos from the Cpu.

Please anyone answer.

Share this post


Link to post
Share on other sites
1. Search:
http://developer.intel.com/ and http://search.amd.com/

for: "CPUID"

Both have sample source code, application sheets etc on using the CPUID instruction to determine information about the CPU (features, frequency etc).


2. Determining the CPU clock frequency isn''t an exact science (particularly on many laptop CPUs which can change clock frequency depending on battery life), so you won''t get a precise value. Most methods involve using another timer such as timeGetTime() to wait for a known time and then using RDTSC to see how many clocks have occurred in that time.



--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites