## tmr - Timer module

### Module Description

The tmr module implements a poll able interval timer. Due to the fact that the ANS standard does not define a way to fetch milliseconds, this module has a environmental dependency.

### Module Words

#### Timer structure

tmr% ( - n )
  Get the required space for the timer variable

#### Timer variable creation, initialisation and destruction

tmr-init ( u tmr -- )
  Initialise the timer with timeout u
tmr-create ( u "<spaces>name" -- ; -- tmr )
  Create a named timer variable in the dictionary with timeout u
tmr-new ( u -- tmr )
  Create a new timer variable on the heap with timeout u
tmr-free ( tmr -- )
  Free the timer from the heap

#### Member words

tmr-timeout@ ( tmr -- u )
  Get the timeout value from the timer
tmr-timer@ ( tmr -- u )
  Get the running time u from the timer in ms, after last [re]start, expired? or wait

#### Timer words

tmr-start ( u tmr -- )
  Start the timer with a timeout value u
tmr-restart ( tmr -- )
  Restart the timer with the current timeout value
tmr-expired? ( tmr -- flag )
  Check if the timer is expired, if so the timer is restarted
tmr-wait ( tmr -- )
  Wait till the timer expires and restart the timer

#### Inspection

tmr-dump ( tmr -- )
  Dump the tmr state

generated 03-Jun-2010 by ofcfrth-0.10.0