module CCTimer:sig
..end
Used to be part of CCFuture
Since 0.16
type
t
val create : unit -> t
val set_exn_handler : t -> (exn -> unit) -> unit
set_exn_handler timer f
registers f
so that any exception
raised by a task scheduled in timer
is given to f
exception Stopped
val after : t -> float -> f:(unit -> 'a) -> unit
f
after the given number of seconds.Stopped
if the timer was stoppedval at : t -> float -> f:(unit -> 'a) -> unit
()
at the given Unix timestampStopped
if the timer was stoppedexception ExitEvery
val every : ?delay:float -> t -> float -> f:(unit -> 'a) -> unit
every timer n ~f
calls f ()
every n
seconds.
f()
can raise ExitEvery to stop the cycle.Stopped
if the timer was stoppeddelay
: if provided, the first call to f ()
is delayed by
that many seconds.val stop : t -> unit
val active : t -> bool
true
until stop t
has been called.