Trivial Timer Manual
[in package TRIVIAL-TIMER]
Trivial Timer allows for easy scheduling of tasks (functions). The default tolerance is +- 10ms as defined by *ms-tolerance*.
This project is available in the latest QuickLisp distribution, so installing it is reduced to calling:
(in-package :trivial-timer) (initialize-timer) (defun timer-callback (registered-time delay) (log:info "I was called by the timer ~a ms after registration. Expected was ~a ms." (- (get-internal-real-time) registered-time) delay)) (let ((delay 1000)) (register-timer-call delay #'timer-callback)) => I was called by the timer 992 ms after registration. Expected was 1000 ms.
[variable] MS-TOLERANCE 10
Time tolerance (default +/- 10ms)
Initialization of trivial-timer. This MUST be called before any other function from this library.
Shutdown the timer. No further calls can be registered. Atention: Stopping is an asynchronous request, meaning that some registered call might still be executed after calling shutdown-timer
[function] REGISTER-TIMER-CALL OFFSET CALL
Register a function call to be executed in offset milliseconds from now.
[function] REGISTER-TIMER-RECURRING-CALL OFFSET CALL
Register a function call to be (recurrently) executed every offset milliseconds.
This library is released under the MIT License. Please refer to the LICENSE to get the full licensing text.
Contributing to this project
Please refer to the CONTRIBUTING document for more information.