      PROGRAM STIMER
C
C     SHORT INTERVAL TIMER ROUTINE
C     PROGRAM ENDS AFTER ICNT COUNTS (TOTAL DELAY <1 HOUR)
C     INTERVAL : 1/18 SEC
C     MIDNIGHT CROSSING RESETS STIMER (STIMER RETURNS)
C     OLYMPIC SOFTWARE  --  9/26/88
C
      EXTERNAL TBIOS
      INTEGER*2 IAR(6),ICNT
      INTEGER*4 ICX,IDX,EC
C
C***    ENTER COUNT NUMBER
      WRITE(*,10)
 10   FORMAT(' ENTER COUNT NUMBER (ONE=1/18 SEC): ',$)
      READ(*,*)ICNT
C
      IAR(1)=0
      CALL TBIOS(IAR)
      IDX=IAR(5)*256+IAR(6)
      IAR(1)=0
 100  CALL TBIOS(IAR)
      EC=IAR(5)*256+IAR(6)-IDX
      IF(EC.LT.0)EC=EC+4*16384
      IF(IAR(2).NE.0)GOTO 200
      IF(EC.LT.ICNT)GOTO 100
C
 200  STOP
      END

