TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Stephen Lindholm
from: Murray Lesser
date: 1994-12-30 15:37:00
subject: Dosstarttimer

Excerpted from message dated 12-28-94, Stephen Lindholm to 
   Jonathan de Boyne Pollard:

SL>Jonathan de Boyne Pollard le escribe a Christian Scarborough:
  >
SL>JdBP>   You are.  18.2Hz is the frequency of the "system
  >JdBP> heartbeat" interrupt   which drives all thread scheduling in
  >JdBP> the system.
  >
SL>I'm curious: Why is 18.2Hz retained as the timer frequency?
  >

Stephen--

    It isn't the OS/2 timer frequency (at least not on my system!).  The
OS/2 clock "ticks" 32 times a second (every 31.25 ms).  However, when in
a VDM, OS/2 supplies a sporadic timer zero interrupt that averages to
the DOS 18.2+ ticks per second, for running those DOS programs counting
interrupts instead of using the system clock.  This pseudo "DOS tick
rate" has nothing to do with native OS/2 functions.

    For a demonstration of the 32 ticks per second, run the following
small OS/2 REXX program (originally published in my piece "Time for
OS/2" in PC TECHNIQUES, v 5, n 3 [Aug/Sept 1994], pp 34-37).  TICKER.CMD
is very poor programming practice, since it counts ticks!  It must be
the _only_ program running on your system at the time, to give accurate
results.  Depending on your memory availability and CPU speed, you may
have to run it a couple of times until your system settles down from
parsing the source code and writing the EA containing the tokenized code
to the file.

_______Cut here______
/* Rexx - TICKER.CMD */
 say 
 say "Measuring the system clock tick rate"
 say "Wait for 1000 ticks (it will seem like longer)..."
 oldtime = time('L')
 do while oldtime = time('L'); end      /* Wait for start of */
 oldtime = time('E')                    /*   next tick       */
 do 1000                                /* Count 1000 ticks  */
    do while oldtime = time('E'); end
    oldtime = time('E')
    end
 tickrate = oldtime / 1                 /* Delete trailing zeros */
 say "The clock ticked every" tickrate "milliseconds."
_______Cut here______
    
               --Murray
___
 * MR/2 2.16 #120 * Quoth the raven: "Have a Good Day"
                                                                           
                                               
---
* Origin: 2" x 4" bbs - a basic board - (914) 271-9407 (1:2625/108)
SEEN-BY: 12/2442 620/243 624/50 632/348 640/820 690/660 711/409 410 413 430
SEEN-BY: 711/807 808 809 934 942 949 712/353 515 713/888 800/1
@PATH: 2625/108 1 261/1023 396/1 3615/50 229/2 12/2442 711/409 808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.