Solved

Processor Speed

Posted on 1998-01-28
6
259 Views
Last Modified: 2010-04-04
Can anyone tell me  how to detect the type of CPU in a machine and its speed?  Say, a Pentium running at 166 mhz?

Thanks

Stu
0
Comment
Question by:SJohnson
6 Comments
 
LVL 5

Expert Comment

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

JB
0
 
LVL 1

Author Comment

by:SJohnson
ID: 1357796
Thanks for that.  I actually found that just after posting this.  But I still need to find the speed.

Again, thanks.

Stuart
0
 
LVL 5

Expert Comment

by:JimBob091197
ID: 1357797
I don't think Delphi declares all the constants for GetSystemInfo, but they are declared in Winnt.h if you have VC++.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 1

Expert Comment

by:buemoh
ID: 1357798
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.
0
 

Accepted Solution

by:
kwang080897 earned 100 total points
ID: 1357799
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;
var
  t: DWORD;
  mhi, mlo, nhi, nlo: DWORD;
  t0, t1, chi, clo, shr32: Comp;
begin
  try
    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 := Format('%.0f MHz', [(t1 - t0) / 1E6])

  except
    Result := 'Ukendt';
  end;
end;
0
 
LVL 1

Author Comment

by:SJohnson
ID: 1357800
Thanks for that kwang.  Worked beautifully.

Again, thanks

Stuart
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now