All Manuals > LispWorks® User Guide and Reference Manual > 42 The MP Package

make-timer Function

Summary

Creates and returns an unnamed timer.

Package

mp

Signature

make-timer function &rest arguments => timer

Arguments
function
A function.
arguments
A set of arguments to function.
Values
timer
A timer.
Description

The function make-timer creates and returns an unnamed timer. function is a function to be applied to arguments when timer expires. Use the function schedule-timer or schedule-timer-relative to set an expiration time.

If function returns the keyword :stop, then timer is unscheduled (as if by unschedule-timer). This allows you to schedule a repeating timer (by passing repeat-time to schedule-timer, schedule-timer-relative, schedule-timer-milliseconds or schedule-timer-relative-milliseconds) that unschedules itself when some condition is true. Otherwise the values returned by function are ignored.

Note that the function make-named-timer creates a named timer.

Examples
(setq timer
      (mp:make-timer 'print 10 *standard-output*))
=>
#<Time Event : PRINT>
See also

make-named-timer
make-timer
schedule-timer
schedule-timer-milliseconds
schedule-timer-relative
schedule-timer-relative-milliseconds
timer-expired-p
timer-name
unschedule-timer
19.9 Timers


LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:51