Eio.Time
Clocks, time, sleeping and timeouts.
val now : _ clock -> float
now t
is the current time since 00:00:00 GMT, Jan. 1, 1970 - in seconds - according to t
.
val sleep_until : _ clock -> float -> unit
sleep_until t time
waits until the given time is reached.
val sleep : _ clock -> float -> unit
sleep t d
waits for d
seconds.
module Mono : sig ... end
Monotonic clocks.
val with_timeout :
_ clock ->
float ->
(unit -> ('a, 'e) Stdlib.result) ->
('a, [> `Timeout ] as 'e) Stdlib.result
with_timeout clock d fn
runs fn ()
but cancels it after d
seconds.
val with_timeout_exn : _ clock -> float -> (unit -> 'a) -> 'a
with_timeout_exn clock d fn
runs fn ()
but cancels it after d
seconds, raising exception Timeout
.
module Timeout : sig ... end
Timeout values.
module Pi : sig ... end