## 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 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.

`min_stamp`

is the earliest timestamp.

`max_stamp`

is the latest timestamp.

`pp`

is a formatter for timestamps.

## Predicates

`val equal : t -> t -> bool`

`equal t t'`

is `true`

iff `t`

and `t'`

are equal.

`val compare : t -> t -> int`

`compare t t'`

orders timestamps by increasing time.

`val is_earlier : t -> than:t -> bool`

`is_earlier t ~than`

is `true`

iff `t`

occurred before `than`

.

`val is_later : t -> than:t -> bool`

`is_later t ~than`

is `true`

iff `t`

occurred after `than`

.

## Arithmetic

`span t t'`

is the span between `t`

and `t'`

regardless of the order between `t`

and `t'`

.

`val add_span : t -> span -> t option`

`add_span t s`

is the timestamp `s`

units later than `t`

or `None`

if the result overflows.

`val sub_span : t -> span -> t option`

`sub_span t s`

is the timestamp `s`

units earlier than `t`

or `None`

if overflows.