tmr - Timer module

Module Description

The tmr module implements words for using a pollable 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 data structure

Timer structure creation, initialisation and destruction

tmr-init ( u:timeout w:tmr - )
Initialise the timer structure

tmr-create ( C: "name" u:timeout - R: - w:tmr )
Create a named timer structure in the dictionary

tmr-new ( u:timeout - w:tmr )
Create a new timer structure on the heap

tmr-free ( w:tmr - )
Free the timer from the heap

Member words

tmr-timeout@ ( w:tmr - u:timeout )
Get the time out value

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

Timer words

tmr-start ( u:timeout w:tmr - )
Start the timer with a timeout value

tmr-restart ( w:tmr - )
Restart the timer with the current timeout value

tmr-expired? ( w:tmr - f )
Check if the timer is expired, if so the timer is restarted

tmr-wait ( w:tmr - )
Wait till the timer expires and restart the timer

Inspection

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


generated 09-Jan-2007 by ofcfrth-0.2.0