package incremental_kernel

  1. Overview
  2. Docs
include module type of struct include Core_kernel.Time_ns.Span end
type t = private Core_kernel.Int63.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.

val hash_fold_t : Ppx_hash_lib.Std.Hash.state -> t -> Ppx_hash_lib.Std.Hash.state
val hash : t -> Ppx_hash_lib.Std.Hash.hash_value
val typerep_of_t : t Typerep_lib.Std.Typerep.t
val typename_of_t : t Typerep_lib.Std.Typename.t
val bin_t : t Bin_prot.Type_class.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
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 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
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
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 scale : t -> Base.Float.t -> t
val scale_int : t -> Base.Int.t -> t

overflows silently

val scale_int63 : t -> Core_kernel.Int63.t -> t

overflows silently

val div : t -> t -> Core_kernel.Int63.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.

val to_parts : t -> Parts.t
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 -> Core_kernel.Int63.t

Fast, implemented as the identity function.

val of_int63_ns : Core_kernel.Int63.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:Core_kernel__.Import.Random.State.t -> Base.Unit.t -> t

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

val sexp_of_t : Core_kernel.Time_ns.Span.t -> Ppx_sexp_conv_lib.Sexp.t
OCaml

Innovation. Community. Security.