Module B0_std.Time.Span

module Span: sig .. end

Time spans


Time spans

type t = B0_std.Time.span 

See B0_std.Time.span.

val zero : B0_std.Time.span

zero is a span of 0ns.

val one : B0_std.Time.span

one is a span of 1ns.

val add : B0_std.Time.span -> B0_std.Time.span -> B0_std.Time.span

add s0 s1 is s0 + s1. Warning. Rolls over on overflow.

val abs_diff : B0_std.Time.span -> B0_std.Time.span -> B0_std.Time.span

abs_diff s0 s1 is the absolute difference between s0 and s1.

Predicates and comparisons

val equal : B0_std.Time.span -> B0_std.Time.span -> bool

equal s0 s1 is s0 = s1.

val compare : B0_std.Time.span -> B0_std.Time.span -> int

compare s0 s1 orders span by increasing duration.

Conversions

val to_uint64_ns : B0_std.Time.span -> int64

to_uint64_ns s is s as an unsigned 64-bit integer nanosecond span.

val of_uint64_ns : int64 -> B0_std.Time.span

of_uint64_ns u is the unsigned 64-bit integer nanosecond span u as a span.

val conv : B0_std.Time.span B0_std.Conv.t

conv is a converter for timespans. Texual conversion parses an atom using Int64.of_string.

val pp : B0_std.Time.span B0_std.Fmt.t

pp formats with B0_std.Fmt.uint64_ns_span.

val pp_ns : B0_std.Time.span B0_std.Fmt.t

pp_ns ppf s prints s as an unsigned 64-bit integer nanosecond span.