package octez-internal-libs
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65
doc/octez-internal-libs.irmin/Irmin/Export_for_backends/Mtime/index.html
Module Export_for_backends.Mtime
Source
include module type of struct include Mtime end
Monotonic time spans
type span = Mtime.span
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).
module Span = Mtime.Span
Monotonic time spans.
Monotonic timestamps
Note. Only use timestamps if you need inter-process time correlation, otherwise prefer Mtime_clock.elapsed
and counters.
type t = Mtime.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.
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.
sub_span t s
is the timestamp s
units earlier than t
or None
if the result underflows.
Formatting
val pp : Format.formatter -> t -> unit
pp
formats t
as an unsigned 64-bit integer nanosecond timestamp. Note that the absolute value is meaningless.
val dump : Format.formatter -> t -> unit
dump ppf t
formats an unspecified raw representation of t
on ppf
.