Module Primus.Time

Machine time.

Each machine has its own clock that is incremented on each operation. When machine is forked, the derived machine inherits the clock value from the parent machine.

type t
val sexp_of_t : t -> Ppx_sexp_conv_lib.Sexp.t
val clocks : t -> int

clocks t is the time t expressed in clocks from the start of machine.

  • since 2.1.0
val of_clocks : int -> t

of_clocks clk represents a time duration equal to the specified number of clocks.

val to_string : t -> string

a string representation of time

val pp : Stdlib.Format.formatter -> t -> unit

time printer

include Base.Comparable.S with type t := t
val (>=) : t -> t -> bool
val (<=) : t -> t -> bool
val (=) : t -> t -> bool
val (>) : t -> t -> bool
val (<) : t -> t -> bool
val (<>) : t -> t -> bool
val equal : t -> t -> bool
val compare : t -> t -> int
val min : t -> t -> t
val max : t -> t -> t
val ascending : t -> t -> int
val descending : t -> t -> int
val between : t -> low:t -> high:t -> bool
val clamp_exn : t -> min:t -> max:t -> t
val clamp : t -> min:t -> max:t -> t Base__.Or_error.t
type comparator_witness
val comparator : (t, comparator_witness) Base__.Comparator.comparator
val validate_lbound : min:t Base__.Maybe_bound.t -> t Base__.Validate.check
val validate_ubound : max:t Base__.Maybe_bound.t -> t Base__.Validate.check
val validate_bound : min:t Base__.Maybe_bound.t -> max:t Base__.Maybe_bound.t -> t Base__.Validate.check