Common Lisp Package: TRIVIAL-TIMERS

README:

FUNCTION

Public

LIST-ALL-TIMERS

Return a list of all timers in the system.

MAKE-TIMER (FUNCTION &KEY NAME (THREAD *CURRENT-THREAD*))

Create a timer that runs FUNCTION when triggered. If a THREAD is supplied, FUNCTION is run in that thread. If THREAD is T, a new thread is created for FUNCTION each time the timer is triggered. If THREAD is NIL, FUNCTION is run in an unspecified thread. When THREAD is not T, INTERRUPT-THREAD is used to run FUNCTION and the ordering guarantees of INTERRUPT-THREAD apply. FUNCTION runs with interrupts disabled but WITH-INTERRUPTS is allowed.

SCHEDULE-TIMER (TIMER TIME &KEY REPEAT-INTERVAL ABSOLUTE-P)

Schedule TIMER to be triggered at TIME. If ABSOLUTE-P then TIME is universal time, but non-integral values are also allowed, else TIME is measured as the number of seconds from the current time. If REPEAT-INTERVAL is given, TIMER is automatically rescheduled upon expiry.

TIMER-NAME (TIMER)

Return the name of TIMER.

TIMER-SCHEDULED-P (TIMER &KEY (DELTA 0))

See if TIMER will still need to be triggered after DELTA seconds from now. For timers with a repeat interval it returns true.

UNSCHEDULE-TIMER (TIMER)

Cancel TIMER. Once this function returns it is guaranteed that TIMER shall not be triggered again and there are no unfinished triggers.

CLASS

Public

TIMER

Timer type. Do not rely on timers being structs as it may change in future versions.