schedule-timer-relative-milliseconds timer relative-expiration-time &optional repeat-time => timer
The function schedule-timer-relative-milliseconds
schedules a timer to expire at a given time after the call to the function. The timer argument is a timer returned by make-timer or make-named-timer. The relative-expiration-time argument is a non-negative real number of milliseconds after the call to the function at which the timer is to expire. If repeat-time is specified, it is a non-negative real number of milliseconds that specifies a repeat interval. Each time the timer expires, it is rescheduled to expire after this repeat interval.
If the timer is already scheduled to expire at the time this function is called, it is rescheduled to expire at the time specified by the relative-expiration-time argument. If that argument is nil
, the timer is not rescheduled, but the repeat interval is set to the interval specified by the repeat-time argument.
The function schedule-timer-milliseconds schedules a timer to expire at a time relative to the start of the program.
schedule-timer-relative-milliseconds
has the same precision as schedule-timer-relative, but may avoid some allocation when computing the time.
The following example schedules a timer to expire 5 seconds after the call to schedule-timer-relative-milliseconds
and every 5 seconds thereafter.
(setq timer
(mp:make-timer 'print 10 *standard-output*))
#<Time Event : PRINT>
(mp:schedule-timer-relative-milliseconds timer 5000
5000)
#<Time Event : PRINT>
make-named-timer
make-timer
schedule-timer
schedule-timer-milliseconds
schedule-timer-relative
timer-expired-p
timer-name
unschedule-timer
LispWorks User Guide and Reference Manual - 13 Feb 2015