Processor Speed

Can anyone tell me  how to detect the type of CPU in a machine and its speed?  Say, a Pentium running at 166 mhz?


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The "GetSystemInfo" api call will return the type of CPU (486, Pentium, etc.) but not the speed...

SJohnsonAuthor Commented:
Thanks for that.  I actually found that just after posting this.  But I still need to find the speed.

Again, thanks.

I don't think Delphi declares all the constants for GetSystemInfo, but they are declared in Winnt.h if you have VC++.
Bootstrap 4: Exploring New Features

Learn how to use and navigate the new features included in Bootstrap 4, the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.

GetSystemInfo can not detect the CPU-speed, but you can read the BIOS, because all newer BIOS store the CPU-speed.
NOTICE: to read BIOS-information you've to change the memory-address (under 640KByte) to selectors, which only can be used in WIN95 or WINNT.

Some years ago I wrote a small programn which does this. May be I find it.
Not long ago, I was looking for the same thing, and found the answer right here on Experts Exchange(Good Place)

I Dont know how this works, but i works thanks to someone on Experts Exchange (dont remember who).

A good advise :

Check some of the previos answered questionon this side:
There is a lot of good stuff (Cheap)

function tmainform.GetCPUSpeed: String;
  t: DWORD;
  mhi, mlo, nhi, nlo: DWORD;
  t0, t1, chi, clo, shr32: Comp;
    shr32 := 65536;
    shr32 := shr32 * 65536;

    t := GetTickCount;
    while t = GetTickCount do begin end;
      DB 0FH
      DB 031H
      mov mhi,edx
      mov mlo,eax

    while GetTickCount < (t + 1000) do begin end;
      DB 0FH
      DB 031H
      mov nhi,edx
      mov nlo,eax

    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 := Format('%.0f MHz', [(t1 - t0) / 1E6])

    Result := 'Ukendt';

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SJohnsonAuthor Commented:
Thanks for that kwang.  Worked beautifully.

Again, thanks

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.