package b0
Install
Dune Dependency
Authors
Maintainers
Sources
sha512=00a6868b4dfa34565d0141b335622a81a0e8d5b9e3c6dfad025dabfa3df2db2a1302b492953bbbce30c3a4406c324fcec25250a00b38f6d18a69e15605e3b07e
doc/b0.std/B0_std/Mtime/index.html
Module B0_std.Mtime
Monotonic time stamps and spans.
This module provides support for representing monotonic wall-clock time. This time increases monotonically and is not subject to operating system calendar time adjustement. Its absolute value is meaningless.
To obtain monotonic time stamps and measure it use Os.Mtime
.
Monotonic time spans
The type for non-negative monotonic time spans. They represent the difference between two monotonic clock readings with nanosecond precision (1e-9s) and can measure up to approximatevely 584 Julian year spans before silently rolling over (unlikely since this is in a single program run).
module Span : sig ... end
Monotonic time spans
Monotonic timestamps
Note. Only use timestamps if you need inter-process time correlation, otherwise prefer Os.Mtime.elapsed
and counters to measure time.
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.
val to_uint64_ns : t -> int64
to_uint64_ns t
is t
as an unsigned 64-bit integer nanosecond timestamp. The absolute value is meaningless.
val of_uint64_ns : int64 -> t
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.
val min_stamp : t
min_stamp
is the earliest timestamp.
val max_stamp : t
max_stamp
is the latest timestamp.
Predicates
Arithmetic
span t t'
is the span between t
and t'
regardless of the order between t
and t'
.
add_span t s
is the timestamp s
units later than t
or None
if the result overflows.