DelphiFAQ Home Search:

Determine the processor speed in MHz

 

commentsThis article has not been rated yet. After reading, feel free to leave comments and rate it.

Here is a handy routine which will return an estimated core processor speed (CPU speed) of your PC. Read the comment to see how to use it.
You need Delphi 3 or higher to compile this.

function GetCpuSpeed: Comp;
 { function to return the CPU clock speed only.                                     } 
 { Usage: MessageDlg(Format('%.1f MHz', [GetCpuSpeed]), mtConfirmation, [mbOk], 0); } 
 var 
   t: DWORD;
   mhi, mlo, nhi, nlo: DWORD; 
   t0, t1, chi, clo, shr32: Comp; 
 begin 
   shr32 := 65536; 
   shr32 := shr32 * 65536; 
 
   t := GetTickCount; 
   while t = GetTickCount do begin end; 
   asm 
     DB 0FH 
     DB 031H 
     mov mhi,edx 
     mov mlo,eax 
   end; 
 
   while GetTickCount < (t + 1000) do begin end;
   asm
     DB 0FH
     DB 031H 
     mov nhi,edx 
     mov nlo,eax 
   end; 
 
   chi := mhi; 
   if mhi < 0 then chi := chi + shr32; 
 
   clo := mlo; 
   if mlo < 0 then clo := clo + shr32; 
 
   t0 := chi * shr32 + clo; 
 
   chi := nhi; 
   if nhi < 0 then chi := chi + shr32; 
 
   clo := nlo; 
   if nlo < 0 then clo := clo + shr32; 
 
   t1 := chi * shr32 + clo; 
 
   Result := (t1 - t0) / 1E6; 
 end;
You don't like the formatting? Check out SourceCoder then!

Comments:

2006-11-20, 08:30:18
anonymous from United States  
I didn't understand a thing. Please be less technical and explain for those who can't understand the jargon. Thank you.
2007-04-29, 12:43:25
anonymous from Botswana  
list processor speeds with examples, eg.very high speed - less speed
2007-04-30, 14:46:52
anonymous from United States  
How Do I Find Out My Processor Speed?



One way is to reboot your PC and see what comes up on the set-up screen. The other way is to go to START, PROGRAMS, ACCESSORIES, SYSTEM TOOLS, then SYSTEM INFORMATION.



Click on SYSTEM INFORMATION and when it opens, click on TOOLS, and then on DIRECTX DIAGNOSTIC TOOLS.



The processor speed should be listed there.

Hope this helps :-)

 

 

Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option.
 
It seems that you are
from Los Angeles, US .

Info/ Feedback on this

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:
photo Add a picture:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity. The owner of this web site reserves the right to delete such material.