On this page:
timer
start-timer-manager
start-timer
reset-timer!
increment-timer!
cancel-timer!

5.1 Timers

This module provides a functionality for running procedures after a given amount of time, that may be extended.

struct

(struct timer (evt expire-seconds action)
  #:extra-constructor-name make-timer)
  evt : evt?
  expire-seconds : number?
  action : (-> void)
evt is an alarm-evt that is ready at expire-seconds. action should be called when this evt is ready.

procedure

(start-timer-manager)  void

Handles the execution and management of timers.

procedure

(start-timer s action)  timer?

  s : number?
  action : (-> void)
Registers a timer that runs action after s seconds.

procedure

(reset-timer! t s)  void

  t : timer?
  s : number?
Changes t so that it will fire after s seconds.

procedure

(increment-timer! t s)  void

  t : timer?
  s : number?
Changes t so that it will fire after s seconds from when it does now.

procedure

(cancel-timer! t)  void

  t : timer?
Cancels the firing of t ever and frees resources used by t.