package incremental_kernel

  1. Overview
  2. Docs
include module type of struct include Core_kernel.Time_ns.Span end
type t

t is immediate on 64bit boxes and so plays nicely with the GC write barrier. Unfortunately, private Int63.t is necessary for the compiler to optimize uses.

include sig ... end
val compare : t -> t -> Base.Int.t
val typerep_of_t : t Typerep_lib.Std.Typerep.t
val typename_of_t : t Typerep_lib.Std.Typename.t
val bin_read_t : t Bin_prot.Read.reader
val __bin_read_t__ : (Base.Int.t -> t) Bin_prot.Read.reader
val bin_reader_t : t Bin_prot.Type_class.reader
val bin_size_t : t Bin_prot.Size.sizer
val bin_write_t : t Bin_prot.Write.writer
val bin_writer_t : t Bin_prot.Type_class.writer
val bin_shape_t : Bin_prot.Shape.t
include Core_kernel.Comparable.Infix 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
include Core_kernel.Comparable.Validate with type t := t
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
include Core_kernel.Comparable.With_zero with type t := t
val validate_positive : t Base.Validate.check
val validate_non_negative : t Base.Validate.check
val validate_negative : t Base.Validate.check
val validate_non_positive : t Base.Validate.check
val is_positive : t -> bool
val is_non_negative : t -> bool
val is_negative : t -> bool
val is_non_positive : t -> bool
val sign : t -> Base__.Sign0.t

Returns Neg, Zero, or Pos in a way consistent with the above functions.

include Base.Equal.S with type t := t
val equal : t Base.Equal.equal
val nanosecond : t
val microsecond : t
val millisecond : t
val second : t
val minute : t
val hour : t
val day : t
val of_ns : Base.Float.t -> t
val of_us : Base.Float.t -> t
val of_ms : Base.Float.t -> t
val of_sec : Base.Float.t -> t
val of_min : Base.Float.t -> t
val of_hr : Base.Float.t -> t
val of_day : Base.Float.t -> t
val to_ns : t -> Base.Float.t
val to_us : t -> Base.Float.t
val to_ms : t -> Base.Float.t
val to_sec : t -> Base.Float.t
val to_min : t -> Base.Float.t
val to_hr : t -> Base.Float.t
val to_day : t -> Base.Float.t
val of_sec_with_microsecond_precision : Base.Float.t -> t
val of_int_us : Base.Int.t -> t
val of_int_ms : Base.Int.t -> t
val of_int_sec : Base.Int.t -> t
val to_int_us : t -> Base.Int.t
val to_int_ms : t -> Base.Int.t
val to_int_sec : t -> Base.Int.t
val zero : t
val min_value : t

The limits of t are chosen to allow conversion to and from float spans with microsecond precision. This property supports Core.Timing_wheel_float in particular. See also Core.Time.

val max_value : t
val (+) : t -> t -> t

overflows silently

val (-) : t -> t -> t

overflows silently

val abs : t -> t

overflows silently on min_value

val neg : t -> t

overflows silently on min_value

val max : t -> t -> t
val scale : t -> Base.Float.t -> t
val scale_int : t -> Base.Int.t -> t

overflows silently

val scale_int63 : t -> Base__.Int63_backends.Dynamic.t -> t

overflows silently

val div : t -> t -> Base__.Int63_backends.Dynamic.t
val (/) : t -> Base.Float.t -> t
val (//) : t -> t -> Base.Float.t
val create : ?sign:Core_kernel.Sign.t -> ?day:Base.Int.t -> ?hr:Base.Int.t -> ?min:Base.Int.t -> ?sec:Base.Int.t -> ?ms:Base.Int.t -> ?us:Base.Int.t -> ?ns:Base.Int.t -> Base.Unit.t -> t

Overflows silently.

Similar to Time.Span.Parts, but adding ns.

val to_parts : t -> Parts.t
val of_parts : Parts.t -> t

overflows silently

val to_unit_of_time : t -> Core_kernel.Unit_of_time.t
val of_unit_of_time : Core_kernel.Unit_of_time.t -> t
include Core_kernel.Interfaces.Robustly_comparable 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 robustly_compare : t -> t -> int
val to_int63_ns : t -> Base__.Int63_backends.Dynamic.t

Fast, implemented as the identity function.

val of_int63_ns : Base__.Int63_backends.Dynamic.t -> t

Fast, implemented as the identity function.

val to_int_ns : t -> Base.Int.t

Will raise on 32-bit platforms. Consider to_int63_ns instead.

val of_int_ns : Base.Int.t -> t
val to_proportional_float : t -> Base.Float.t

The only condition to_proportional_float is supposed to satisfy is that for all t1, t2 : t: to_proportional_float t1 /. to_proportional_float t2 = t1 // t2.

val since_unix_epoch : Base.Unit.t -> t
val random : ?state:Base.Random.State.t -> Base.Unit.t -> t

Note that we expose a sexp format that is not the one exposed in Core.

OCaml

Innovation. Community. Security.