
Timer Module
===== ======

 1991-2020 DEEJ Technology PLC

Provides SWI's and *commands for use in timing programs.
SWI chunk base &490C0 (Acorn Registered).

SWI "Timer_Start"       Turns timer on.
SWI "Timer_Stop"        Returns time interval between last Timer Start,
                        may be called many times.
                        R0 = time in seconds
                        R1 = remainder in microseconds
SWI "Timer_Value"       Returns monotonoc time in seconds and microseconds.
                        R0 = time in seconds
                        R1 = remainder in microseconds

*TimerStart             Equivelent to SWI "Timer_Start"
*TimerStop              Stops timer and prints time elapsed message.
*TimerValue             Prints monotonic time to microsecond resolution.
*TimedOS                Creates GOS type command shell and times all
                        commands given until a *QUIT, (remember Arthur OS?)


==> Help on keyword TimerMod
Module is: Timer Module    4.19 (11-Jun-2020) [32bit]

Commands provided:
TimerStart      TimerStop       TimerValue      TimedOS

It has help on:
TimerMod

==> Help on keyword TimerStart
*TimerStart starts the Timer module interval timer, canceling any previous TimerStart.
Syntax: *TimerStart


==> Help on keyword TimerStop
*TimerStop stops the Timer module interval timer, printing the time elapsed since the last TimerStart.
Syntax: *TimerStop


==> Help on keyword TimerValue
*TimerValue prints the system monotonic time to microsceond resolution.
Syntax: *TimerValue


Technical Information
---------------------

On all machines the module uses the CMOS clock for time calculations to
1 centisecond resolution. Microsecond resolution is provided by hardware
specific timers. On Risc PC, A7000 and Archimedes machines the 2MHz 
IOMD/IOC timer 0 is used. On RISC OS 5 machines the HAL counter 0 is
read, which on the Iyonix is provided by the XScale 80321 and runs at 200MHz.
It also works on the Raspberry Pi which has a 1MHz timer.


SWI numbers
-----------
Timer_Start &490C0
Timer_Stop  &490C1
Timer_Value &490C2


Versions
--------
1.00 Initial release
2.00 *commands added
3.00 SWI chunk base now registered with Acorn
4.00 Iyonic HAL and 32bit neutral version
4.10 Uses own time to string routine to prevent timezone offsets
4.11 Fixed counter wrapping comparison bug
4.12 Fixed IOC conter off by 1
4.13 Fixed us value out of range due to RTCAdjust modules
4.14 Uses HAL direct calls
4.15 Fixed prompt output in TimedOS mode
4.16 Fixed bug where HAL counter period is slightly less 10000 on Raspberry Pi
     Fixed time display in TimedOS broken by 4.15
4.17 Counter period corrected for NetTime adjustment
4.18 ARM2 compatibility courtesy of David Thomas
4.19 Changes by David Thomas
     Fixed issuing *TimedOS within *TimedOS causing a crash
     Fixed "*Quite" etc. working as if *Quit within *TimedOS
     Added copyright to the module help string
