<<<<<<<<<<<<<<<<<

Timer(unix) LYMB Timer(unix)

NAME

timer - a stopwpatch-like object

DESCRIPTION

A timer object returns elapsed time between events as a scalar value. The elapsed time has a resolution of one second for SGI, and millisecond for Sun, HP, and DEC systems (in which case the decimal points are for milliseconds). Split times can also be returned (querying the elapsed time without stopping the timer). To convert the time in milliseconds to day/month/year format, add 731080000 the reported seconds so the sum represent in seconds is since 00:00:00 GMT, Jan. 1, 1970. For SGI, the time is reported in integer since 00:00:00 GMT, Jan. 1, 1970.

SUPERCLASS

object

MESSAGES

start! Start the timer.

stop! Stop the timer.

reset! Resets the timer, elapsed time is now zero seconds.

time? Get the current time of the timer. If the timer was not started, zero is returned. If the timer is running, the elapsed time is returned and the timer continues to run. If the timer has been stopped, the elapsed time between the start! and the stop! messages is returned.

start_time? Returns the time when start! was sent. end_time? Returns the time when stop! was sent.

EXAMPLE

timer new: t1 start!;

(do something here)

t1 print:time; t1: time= (13.000000)

SEE ALSO

time(3C), ftime(3C).

Note: If your system supports ftime(), the timer class will have millisecond resolution.


Please send comments and suggestions to
consult@rpi.edu