Module B0.Time

module Time: sig .. end
Timing.


Monotonic time


type span 
The type for non-negative monotonic time spans. They represent the difference between two monotonic clock readings.
val zero : span
zero is a span of 0ns.
val add : span -> span -> span
add s0 s1 is s0 + s1.
val sub : span -> span -> span
FIXME define abs_diff.
val to_ns : span -> float
to_ns s is s in nanoseconds (1e-9).
val to_uint64_ns : span -> int64
to_uint64_ns s is s as an unsigned 64-bit integer nanosecond span.
val of_uint64_ns : int64 -> span
of_uint64_ns u is the unsigned 64-bit integer nanosecond span u as a span.
val pp_span : span B0.Fmt.t
pp_span ppf s prints an unspecified representation of s on ppf. The representation is not fixed-width, depends on the magnitude of s and uses locale independent standard time scale abbreviations.
val pp_span_uint_ns : span B0.Fmt.t
pp_span_uint_ns ppf s prints s as an unsigned 64-bit integer nanosecond span.
val compare_span : span -> span -> int
compare_span s0 s1 orders span by increasing duration.
type counter 
The type for monotonic wall-clock time counters.
val counter : unit -> counter
counter () is a counter counting from now on.
val count : counter -> span
count c is the monotonic time span elapsed since c was created.

CPU time


type cpu 
The type for CPU execution time.
type cpu_counter 
The type for CPU time counters.
val cpu_counter : unit -> cpu_counter
cpu_counter () is a counter counting from now on.
val cpu_count : cpu_counter -> cpu
cpu_count c are CPU times since c was created.
val cpu_zero : cpu
cpu_zero is zero CPU times.
val cpu_utime_s : cpu -> float
cpu_utime_s cpu is cpu's user time in seconds.
val cpu_stime_s : cpu -> float
cpu_stime_s cpu is cpu's system time in seconds.
val cpu_children_utime_s : cpu -> float
cpu_utime_s cpu is cpu's user time in seconds for children processes.
val cpu_children_stime_s : cpu -> float
cpu_utime_s cpu is cpu's system time in seconds for children processes.
val pp_float_s : float B0.Fmt.t
pp_span ppf s prints an unspecified representation of s on ppf. The representation is not fixed-width, depends on the magnitude of s and uses locale independent standard time scale abbreviations.