module Timer:sig
..end
Timer handles are used to schedule callbacks to be called in the future.
type
t
include Uwt.Handle
val to_handle : t -> Uwt.Handle.t
val sleep : int -> unit Lwt.t
sleep d
is a thread that remains suspended for d
milliseconds
and then terminates.
val start : repeat:int ->
timeout:int -> cb:(t -> unit) -> t uv_result
Timers, that are executed only once (repeat=0), are automatically closed.
After their callback have been executed, their handles are invalid.
Call close
to stop a repeating timer
val start_exn : repeat:int -> timeout:int -> cb:(t -> unit) -> t