?
Solved

Processor Speed

Posted on 1998-01-28
6
Medium Priority
?
265 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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 400 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month11 days, 17 hours left to enroll

752 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