package timere

  1. Overview
  2. Docs
type t = private {
  1. days : int;
  2. hours : int;
  3. minutes : int;
  4. seconds : int;
  5. ns : int;
}

Unsigned/scalar magnitude of a period of time

Conversion to and from Span.t is lossless, but cannot convert from negative span

val make : ?days:int -> ?hours:int -> ?minutes:int -> ?seconds:int -> ?ns:int -> unit -> t
  • raises Invalid_argument

    if any of the arguments are negative

val make_frac : ?days:float -> ?hours:float -> ?minutes:float -> ?seconds:float -> ?ns:int -> unit -> t
  • raises Invalid_argument

    if any of the arguments are negative

val zero : t
val equal : t -> t -> bool
val of_span : Span.t -> t
  • raises Invalid_argument

    if span is negative

val to_span : t -> Span.t
val to_string : t -> string
val pp : Stdlib.Format.formatter -> t -> unit
val to_sexp : t -> CCSexp.t
val to_sexp_string : t -> string
val of_sexp : CCSexp.t -> (t, string) Stdlib.result
val of_sexp_string : string -> (t, string) Stdlib.result
val pp_sexp : Stdlib.Format.formatter -> t -> unit
OCaml

Innovation. Community. Security.