2 @comment node-name, next, previous, up
5 SBCL supports a system-wide event scheduler implemented on top of
6 @code{setitimer} that also works with threads but does not require a
7 separate scheduler thread.
9 The following example schedules a timer that writes ``Hello, word'' after
13 (schedule-timer (make-timer (lambda ()
14 (write-line "Hello, world")
19 It should be noted that writing timer functions requires special care,
20 as the dynamic environment in which they run is unpredictable: dynamic
21 variable bindings, locks held, etc, all depend on whatever code was
22 running when the timer fired. The following example should serve as
29 (format t "~&foo=~S~%" *foo*)
33 (schedule-timer (make-timer #'show-foo) 0.5)
34 (schedule-timer (make-timer #'show-foo) 1.5)
37 (let ((*foo* :surprise!))
41 @section Timer Dictionary
43 @include struct-sb-ext-timer.texinfo
44 @include fun-sb-ext-make-timer.texinfo
45 @include fun-sb-ext-timer-name.texinfo
46 @include fun-sb-ext-timer-scheduled-p.texinfo
47 @include fun-sb-ext-schedule-timer.texinfo
48 @include fun-sb-ext-unschedule-timer.texinfo
49 @include fun-sb-ext-list-all-timers.texinfo