Os.Mtime
Monotonic time clock and sleep.
See B0_std.Mtime
for a discussion about monotonic time.
val now : unit -> Mtime.t
now ()
is the current system-relative monotonic timestamp. Its absolute value is meaningless.
val elapsed : unit -> Mtime.Span.t
elapsed ()
is the monotonic time span elapsed since the beginning of the program.
val counter : unit -> counter
counter ()
is a counter counting from now on.
val count : counter -> Mtime.Span.t
count c
is the monotonic time span elapsed since c
was created.
The functions elapsed
, now
, counter
, raise Sys_error
whenever they can't determine the current time or that it doesn't fit in Mtime
's range. Usually this exception should only be catched at the toplevel of your program to log it and abort the program. It indicates a serious error condition in the system.
clock_gettime
with CLOCK_MONOTONIC.mach_absolute_time
.