type t = private float
module Parts : sig .. end
type t = private {
sign : Core_kernel.Std.Float.Sign.t;
hr : int;
min : int;
sec : int;
ms : int;
us : int;
}
val t_of_sexp : Sexplib.Sexp.t -> t
val sexp_of_t : t -> Sexplib.Sexp.t
include Core_kernel.Std.Comparable_binable with type t := t
include Core_kernel.Std.Comparable.With_zero with type t := t
include Core_kernel.Std.Floatable with type t := t
include Core_kernel.Std.Hashable_binable with type t := t
include Core_kernel.Std.Pretty_printer.S with type t := t
include Core_kernel.Std.Robustly_comparable with type t := t
val to_string : t -> string
val of_string : string -> t
val nanosecond : t
val microsecond : t
val millisecond : t
val second : t
val minute : t
val hour : t
val day : t
val epsilon : t
val zero : t
val create : ?sign:Core_kernel.Std.Float.Sign.t ->
?day:int ->
?hr:int -> ?min:int -> ?sec:int -> ?ms:int -> ?us:int -> unit -> t
val to_parts : t -> Parts.t
val of_ns : float -> t
val of_us : float -> t
val of_ms : float -> t
val of_sec : float -> t
val of_int_sec : int -> t
val of_min : float -> t
val of_hr : float -> t
val of_day : float -> t
val to_ns : t -> float
val to_us : t -> float
val to_ms : t -> float
val to_sec : t -> float
val to_min : t -> float
val to_hr : t -> float
val to_day : t -> float
val (+) : t -> t -> t
Basic operations on spans
val (-) : t -> t -> t
val abs : t -> t
absolute value
val neg : t -> t
negation
val scale : t -> float -> t
val (/) : t -> float -> t
val (//) : t -> t -> float
val to_short_string : t -> string
to_short_string t pretty-prints approximate time span using no more than five characters if the span is positive, and six if the span is negative. Examples
  • "4h" = 4 hours
  • "5m" = 5 minutes
  • "4s" = 4 seconds
  • "10ms" = 10 milliseconds

only the most significant denomination is shown.

val randomize : t -> percent:float -> t
randomize t ~percent returns a span +/- percent * original span. Percent must be between 0 and 1, and must be positive.
module Stable : sig .. end
module V1 : sig .. end
include sig .. end with type __pa_nonrec_0 := t
type __pa_nonrec_0 = t
type t = __pa_nonrec_0
val compare : t -> t -> int
val bin_t : t Core_kernel.Std.Bin_prot.Type_class.t
val bin_read_t : t Core_kernel.Std.Bin_prot.Read.reader
val __bin_read_t__ : (int -> t) Core_kernel.Std.Bin_prot.Read.reader
val bin_reader_t : t Core_kernel.Std.Bin_prot.Type_class.reader
val bin_size_t : t Core_kernel.Std.Bin_prot.Size.sizer
val bin_write_t : t Core_kernel.Std.Bin_prot.Write.writer
val bin_writer_t : t Core_kernel.Std.Bin_prot.Type_class.writer
val t_of_sexp : Sexplib.Sexp.t -> t
val sexp_of_t : t -> Sexplib.Sexp.t
val t_of_sexp : Sexplib.Sexp.t -> t
val sexp_of_t : t -> Sexplib.Sexp.t
val bin_t : t Core_kernel.Std.Bin_prot.Type_class.t
val bin_read_t : t Core_kernel.Std.Bin_prot.Read.reader
val __bin_read_t__ : (int -> t) Core_kernel.Std.Bin_prot.Read.reader
val bin_reader_t : t Core_kernel.Std.Bin_prot.Type_class.reader
val bin_size_t : t Core_kernel.Std.Bin_prot.Size.sizer
val bin_write_t : t Core_kernel.Std.Bin_prot.Write.writer
val bin_writer_t : t Core_kernel.Std.Bin_prot.Type_class.writer