Module Luv.Time

type t = {
tv_sec : int64;
tv_usec : int32;

Binds uv_timeval64_t.

val gettimeofday : unit -> (tError.t) Result.result

Binds uv_gettimeofday. See gettimeofday(3p).

Requires libuv 1.28.0.

Feature check: Luv.Require.(has gettimeofday)

val hrtime : unit -> Unsigned.uint64

Samples the high-resolution timer.

Binds uv_hrtime. See clock_gettime(3p).

val sleep : int -> unit

Suspends the calling thread for at least the given number of milliseconds.

Binds uv_sleep. See sleep(3p).

Requires libuv 1.34.0.

Feature check: Luv.Require.(has sleep)