object encapsulates an event-based alarm. To use a
timer, either instantiate it with a timer-callback
perform the alarm-based action, to derive a new class and override
method to perform the alarm-based
action. Start a timer with start
and stop it with
. Supplying an initial interval
milliseconds) when creating a timer also starts the timer.
Timers have a relatively high priority in the event queue. Thus, if
the timer delay is set low enough, repeated notification for a timer
can preempt user activities (which might be directed at stopping the
timer). For timers with relatively short delays, call yield
within the notify procedure to allow guaranteed event
See Event Dispatching and Eventspaces for more information about event
thunk is called by the default
method when the timer expires.
If interval is #f (the default), the timer is not
started; in that case, start must be called
explicitly. If interval is a number (in milliseconds), then
start is called with interval and
Returns the number of milliseconds between each timer expiration (when
the timer is running).
Called (on an event boundary) when the timer’s alarm expires.
Calls the notify-callback procedure that was provided when the
object was created.
Starts (or restarts) the timer. If the timer is already running, its
alarm time is not changed.
The timer’s alarm expires after msec milliseconds, at which
point notify is called (on an event boundary). If
just-once? is #f, the timer expires every
msec milliseconds until the timer is explicitly
stopped. (More precisely, the timer expires msec
milliseconds after notify returns each time.)
Otherwise, the timer expires only once.
Stops the timer. A stopped timer never calls
. If the timer has expired but the call to
has not yet been dispatched, the call is removed from the event queue.