Mtime has platform independent support for monotonic wall-clock
time. This time increases monotonically and is not subject to
operating system calendar time adjustments.

Time spans represent non-negative monotonic time spans
between two monotonic clock readings. Timestamps
represent system-relative monotonic timestamps, their absolute
value is meaningless but they can be compared across the processes
of an operating system run.

Mtime_clock provides access to a system monotonic clock.

The type for non-negative monotonic time spans. They represent the
difference between two monotonic clock readings. If the platform's
clock has nanosecond resolution the representation guarantees that
the function Mtime_clock.elapsed can measure up to
approximatively 584 Julian year spans before silently rolling over
(unlikely since this is in a single program run).

Note. Only use timestamps if you need inter-process time
correlation, otherwise prefer Mtime_clock.elapsed and
counters.

type t

The type for monotonic timestamps relative to an indeterminate
system-wide event (e.g. last startup). Their absolute value has no
meaning but can be used for inter-process time correlation.

to_uint64_ns t is t is an unsigned 64-bit integer
nanosecond timestamp as a timestamp.

Warning. Timestamps returned by this function should only be
used with other timestamp values that are know to come from the
same operating system run.

dump ppf t prints an unspecified raw representation of t on ppf.

Time scale conversion

The following convenience constants relate time scales to seconds.
Used as multiplicands they can be used to convert these units
to and from seconds.

The constants are defined according to
SI
prefixes on seconds and
accepted
non-SI units. Years are counted in Julian years (365.25 SI-accepted days)
as defined
by the International Astronomical Union (IAU).

val ns_to_s : float

ns_to_s is 1e-9 the number of seconds in one nanosecond.

val us_to_s : float

us_to_s is 1e-6, the number of seconds in one microsecond.

val ms_to_s : float

ms_to_s is 1e-3, the number of seconds in one millisecond.

val min_to_s : float

min_to_s is 60., the number of seconds in one SI-accepted minute.

val hour_to_s : float

hour_to_s is 3600., the number of seconds in one SI-accepted hour.

val day_to_s : float

day_to_s is 86_400., the number of seconds in one SI-accepted day.

val year_to_s : float

year_to_s is 31_557_600., the number of seconds in a Julian year.

val s_to_ns : float

s_to_ns is 1e9 the number of nanoseconds in one second.

val s_to_us : float

s_to_us is 1e6, the number of microseconds in one second.

val s_to_ms : float

s_to_ms is 1e3, the number of milliseconds in one second.

val s_to_min : float

s_to_min is 1. /. 60., the number of SI-accepted minutes in
one second.

val s_to_hour : float

s_to_hour is 1. /. 3600., the number of SI-accepted hours in
one second.

val s_to_day : float

s_to_day is 1. /. 86400., the number of SI-accepted days in
one second.

val s_to_year : float

s_to_year is 1. /. 31_557_600., the number of Julian years
in one second.