The Timer
The 'get-time' function is a 1 place function that returns a floating point number. The range of
arguments supported by this function is implementation dependent as are the results.
For the argument 'real' it should return a value representing real time i.e. two invocations of
this function on real time should be seperated by an amount of time equal to the difference of
their values. As such 'get-time' can be used to measure the wall time elapsed between calls. The
exact value of the results returned is implementation dependent as are the number of places used
but the basic unit of measure should be seconds.
It is optional to set this function to record not real time, but run time; that is the actual
CPU time. The argument run should return a value that is implementation dependent, but the difference
between the two invocations of this function on run time should be seperated by an amount of time
equal to the CPU time expended by Shen between the two calls. The exact value of the results returned
is implementation dependent as are the number of places used.
The argument 'unix' should return a number representing UNIX time in seconds i.e. the time elapsed
since midnight, January 1st, 1970.
Note that not all platforms may support both 'run' and real but either 'run' or 'real' should be
supported. In either case the timer function built into Shen should reflect in the information provided
whether run time or real time is being measured. If an argument is not supported then an appropriate error
should be raised. |