[comp.os.msdos.programmer] realtime CPU speed

keirje@triton.unm.edu (Keirje Aldranske) (10/09/90)

   I want to create a program to monitor effective CPU speed (mhz).  Are there
 any established CPU speed test algorithms or code?  I have seen a number of
 programs which test the processor speed...anyone have any inside knowledge?

       - Thanks for any help, Kay

keirje@triton.unm.edu (Keirje Aldranske) (10/15/90)

    I posted something similar to this some time ago.  I did not receive
  any responses aside from othe people wanting to know what answer I
  received.  So, I am re-posting...


  How does one determine the *effective* or even the actuall cpu speed
  in realtime? 

  I can run a timed loop and find load average (X Windows Style) but I want
  the effective mhz.  I know there are several programs which do this:
  MicroScope(PC Mag) and CPUSPEED and a few other... any help will be
  appreciated.

                 - Kay

jdudeck@polyslo.CalPoly.EDU (John R. Dudeck) (10/15/90)

In an article keirje@triton.unm.edu (Keirje Aldranske) wrote:
>  How does one determine the *effective* or even the actuall cpu speed
>  in realtime? 
>
>  I can run a timed loop and find load average (X Windows Style) but I want
>  the effective mhz.  I know there are several programs which do this:
>  MicroScope(PC Mag) and CPUSPEED and a few other... any help will be
>  appreciated.

When you say "effective cpu speed", I question what that is supposed to
mean.  After all, even when the system is sitting in COMMAND.COM
running in a wait loop, it is running at the full CPU speed.

Are you thinking of some sort of tachometer which would indicate what
amount of useful work is being done, referenced to the CPU clock speed?
For example, if my clock speed is 25 Mhz, and I am sitting in a wait
loop, it should indicate 0 Mhz, and if it is doing full number crunching
to recalculate a spreadsheet it should read 25 Mhz.  During disk access
it should indicate something in between, etc?

The only way that would be possible is if DOS had some sort of system
state variable that indicates what it is doing, and which could be
monitored by a TSR program, which would then calculate the effective
speed and display it.  This is what I believe you are suggesting by 
displaying the "load average", but as far as I know this is not possible
because this information does not exist in DOS.

But perhaps you want a program that measures the CPU clock frequency,
working backwards from the known number of CPU cycles necessary to
perform some operation, and timing the rate at which the operation is
executed.  This would be what you mean by "actual CPU speed".  There
are programs that do this, though I can't remember what any of them are
called, or where to find them.

But there is another type of information that is useful to know.  This
is the percentage of time the CPU is not doing useful work, such as
during RAM refresh, RAM wait states, I/O bus wait states, etc.  Also it
would be interesting to know how much time is spent waiting for disk
I/O.  This is the type of information that is compared in benchmarks,
though I've never seen one which displays it in this way.  Usually they
give a figure of merit that shows the overall effect of these elements
combined with the CPU speed, and resulting in a relative, not absolute
performance figure.  Norton's SI would be in this category.

-- 
John Dudeck                                  "Nothing is foolproof, because
jdudeck@Polyslo.CalPoly.Edu                        fools are so ingenious."
ESL: 62013975 Tel: 805-545-9549                       -- quote from PC Mag.

keirje@triton.unm.edu (Keirje Aldranske) (10/15/90)

In article <27191cec.5488@petunia.CalPoly.EDU> jdudeck@polyslo.CalPoly.EDU (John R. Dudeck) writes:
>
>
>In an article keirje@triton.unm.edu (Keirje Aldranske) wrote:
>>  How does one determine the *effective* or even the actuall cpu speed
>>  in realtime? 
>>
>>  I can run a timed loop and find load average (X Windows Style) but I want
>>  the effective mhz.  I know there are several programs which do this:
>>  MicroScope(PC Mag) and CPUSPEED and a few other... any help will be
>>  appreciated.
>
>When you say "effective cpu speed", I question what that is supposed to
>mean.  After all, even when the system is sitting in COMMAND.COM
>running in a wait loop, it is running at the full CPU speed.
>
>Are you thinking of some sort of tachometer which would indicate what
>amount of useful work is being done, referenced to the CPU clock speed?
>For example, if my clock speed is 25 Mhz, and I am sitting in a wait
>loop, it should indicate 0 Mhz, and if it is doing full number crunching
>to recalculate a spreadsheet it should read 25 Mhz.  During disk access
>it should indicate something in between, etc?
>
>The only way that would be possible is if DOS had some sort of system
>state variable that indicates what it is doing, and which could be
>monitored by a TSR program, which would then calculate the effective
>speed and display it.  This is what I believe you are suggesting by 
>displaying the "load average", but as far as I know this is not possible
>because this information does not exist in DOS.
>
>But perhaps you want a program that measures the CPU clock frequency,
>working backwards from the known number of CPU cycles necessary to
>perform some operation, and timing the rate at which the operation is
>executed.  This would be what you mean by "actual CPU speed".  There
>are programs that do this, though I can't remember what any of them are
>called, or where to find them.
>
>But there is another type of information that is useful to know.  This
>is the percentage of time the CPU is not doing useful work, such as
>during RAM refresh, RAM wait states, I/O bus wait states, etc.  Also it
>would be interesting to know how much time is spent waiting for disk
>I/O.  This is the type of information that is compared in benchmarks,
>though I've never seen one which displays it in this way.  Usually they
>give a figure of merit that shows the overall effect of these elements
>combined with the CPU speed, and resulting in a relative, not absolute
>performance figure.  Norton's SI would be in this category.
>
>-- 
>John Dudeck                                  "Nothing is foolproof, because
>jdudeck@Polyslo.CalPoly.Edu                        fools are so ingenious."
>ESL: 62013975 Tel: 805-545-9549                       -- quote from PC Mag.



   I am talking about running this program on a multi-tasking machine.  
   ie. DesqView or Windows 3.0  I already have a working version of
   an XLoad type program.  I want to be able to determine effective CPU
   mhz as you mentioned in your posting for a tachometer.

            - Kay