Module description

tmr -- Timer module
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.

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 by fsdocgen 0.1.0