Imandrakit_thread.Timer
Timer.
Keep track of multiple timers, using a background thread. The timer is thread-safe. It runs callbacks from within its own background thread.
module Handle : sig ... end
val timer_error : Imandrakit.Error_kind.t
val run_after_s : t -> float -> (unit -> unit) -> unit
run_after_s t f
waits t
seconds and then runs f
val run_every_s : t -> ?initial:float -> float -> (unit -> unit) -> unit
run_every ~initial t f
waits initial
seconds and then runs f()
every t
seconds. f ()
can raise Stop_timer
to stop the loop.
val create : unit -> t
New timer
val terminate : t -> unit
Stop the timer