'===========================================================================
' Subject: TIMER FUNCTIONS                    Date: 09-30-92 (09:42)       
'  Author: Matt Pritchard                     Code: QB, QBasic, PDS        
'  Origin: FidoNet QUIK_BAS Echo            Packet: DATETIME.ABC
'===========================================================================
'>Start! = TIMER   'Start! had to be a single so it can handle the ma
'> 'amount that timer returns (86400) and so it can save
'>                 ' the decimal place.


'>> Do the peeks directly and use an INTEGER or LONG.... It'll be a whole
'>> lot faster than involving floating point...

'>How can I do that?  I got SMALLEXE.BAS from the QB news and it had a
'>TIMER  replacement, but after midnight, it wouldn't reset to 0!
'> And it hardley ever  returned the same thing as TIMER (it
'>started out at 4 million whenever I ran  the program!)!

You can do this:

        DEF SEG = 0
        TimerLo% = PEEK (&h046C)

        (or)

        TimerFull& = PEEK (&h046C) + 256& * PEEK(&h046D)

        or in assembly ...

;TIMERCOUNT - QuickBASIC 4.5 File Timer Value Returned: ;DECLARE
FUNCTION TIMERCOUNT% ;Count = TIMERCOUNT% ;

        PUBLIC  TIMERCOUNT

TIMERCOUNT      PROC    FAR

        XOR     AX,AX               ;Segment = 0000
        MOV     ES,AX
        MOV     AX,ES:[046Ch]       ;Get Timer Word..

        RET

TIMERCOUNT      ENDP

