[comp.sys.ibm.pc.misc] How do I determine the clock speed?

dslg0849@uxa.cso.uiuc.edu (Daniel S. Lewart) (12/03/90)

Can anyone point me to or provide me with some code (preferably in Pascal)
which will determine the clock speed?

Thanks in advance,

Daniel Lewart
d-lewart@uiuc.edu

robl@idca.tds.PHILIPS.nl (R. Luursema) (12/07/90)

In article <1990Dec3.061630.22992@ux1.cso.uiuc.edu> dslg0849@uxa.cso.uiuc.edu (Daniel S. Lewart) writes:
>Can anyone point me to or provide me with some code (preferably in Pascal)
>which will determine the clock speed?
>
>Thanks in advance,
>
>Daniel Lewart
>d-lewart@uiuc.edu

Basically, you can't determine the CPU clockspeed of an arbitrary PC.

What you can do is determine CPU type and 
some relative speed against a known system (like IBM PC/XT), by 
executing some instruction mix and time execution speed.
However this number can tell only little about CPU clock speed; it
will give different numbers on similar systems with the same CPU and 
clock speed.

If you want source (TP), look at INFOPLUS, posted in comp.binaries.ibm.pc
about a month ago (infop131.zoo). A even more recent version should be
available on SIMTEL20 or any mirror archives.

Rob.
--
#---------------------------------------#       ______
# Rob Luursema,   BS-HW,  V1b2 ext 2246 #      /____ / organized
# Philips Information Systems Apeldoorn #     /____ / like the 
# Domain:      robl@idca.tds.philips.nl #    /____ / tower of
# UUCP:           ..!hp4nl!philapd!robl #   /____ / pisa ...
#include <std/disclaimer>               #  /____ / 
#---------------------------------------# ========
 A good workman is known by his tools

dslg0849@uxa.cso.uiuc.edu (Daniel S. Lewart) (12/08/90)

robl@idca.tds.PHILIPS.nl (R. Luursema) writes:

> Basically, you can't determine the CPU clockspeed of an arbitrary PC.
>
> What you can do is determine CPU type and 
> some relative speed against a known system (like IBM PC/XT), by 
> executing some instruction mix and time execution speed.
> However this number can tell only little about CPU clock speed; it
> will give different numbers on similar systems with the same CPU and 
> clock speed.
>
> If you want source (TP), look at INFOPLUS, posted in comp.binaries.ibm.pc
> about a month ago (infop131.zoo). A even more recent version should be
> available on SIMTEL20 or any mirror archives.

Thanks, Rob.  I looked at INFOPLUS 1.40 and it has code to determine the CPU
type, not the clock speed.  This would be fine, but it doesn't (and cannot)
identify all the types of clones.  Thus, it is not sufficiently general.

Dan
d-lewart@uiuc.edu

rcollins@altos86.Altos.COM (Robert Collins) (12/11/90)

>robl@idca.tds.PHILIPS.nl (R. Luursema) writes:
>
>> Basically, you can't determine the CPU clockspeed of an arbitrary PC.
>>

Oh really?  It isn't that hard.  I've got a subroutine that is accurate to
1 decimal point (33Mhz = 33Mhz +- .1Mhz).  For the majority of the time, it
is 100% accurate.

I'll give you a hint:
* The timer chip has 838nS resolution
* Execute 838 of the same instructions (with a known CPU_CLOCK count) and
  time them.

I'll leave the rest of this as an excersize to the reader (the programmer),
as I don't feel like reducing my competitive advantage in the job market.

P.S. This algorithm as it stands will be good to about 60Mhz.



-- 
"Worship the Lord your God, and serve him only."  Mat. 4:10
Robert Collins                 UUCP:  ...!sun!altos86!rcollins
HOME:  (408) 225-8002
WORK:  (408) 432-6200 x4356

LIRAKLIO@MIAMIU.BITNET (LEO J IRAKLIOTIS) (12/12/90)

Try to get files MIPS.EXE and CPUTEST.EXE from <WUARCHIVE.WUSTL.EDU>
via anonymous FTP.
 
Both are returning CPU frequency and MIPS number.
 
Feel free to contact me for more info.
 
Leo Irakliotis.-