Module Core_kernel__Time_ns.Span

type t = private Core_kernel__.Std_internal.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.

include sig ... end
val bin_read_t : t Bin_prot.Read.reader
val __bin_read_t__ : (Core_kernel__.Import.int ‑> 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 typerep_of_t : t Typerep_lib.Std.Typerep.t
val typename_of_t : t Typerep_lib.Std.Typename.t
val compare : t ‑> t ‑> Core_kernel__.Import.int
include Core_kernel.Comparable.Infix with type t := t
type 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
type 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
type 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 Core_kernel__.Import.Equal.S with type t := t
type 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 : Core_kernel__.Import.float ‑> t
val of_us : Core_kernel__.Import.float ‑> t
val of_ms : Core_kernel__.Import.float ‑> t
val of_sec : Core_kernel__.Import.float ‑> t
val of_min : Core_kernel__.Import.float ‑> t
val of_hr : Core_kernel__.Import.float ‑> t
val of_day : Core_kernel__.Import.float ‑> t
val to_ns : t ‑> Core_kernel__.Import.float
val to_us : t ‑> Core_kernel__.Import.float
val to_ms : t ‑> Core_kernel__.Import.float
val to_sec : t ‑> Core_kernel__.Import.float
val to_min : t ‑> Core_kernel__.Import.float
val to_hr : t ‑> Core_kernel__.Import.float
val to_day : t ‑> Core_kernel__.Import.float
val of_sec_with_microsecond_precision : Core_kernel__.Import.float ‑> t
val of_int_us : Core_kernel__.Import.int ‑> t
val of_int_ms : Core_kernel__.Import.int ‑> t
val of_int_sec : Core_kernel__.Import.int ‑> t
val to_int_us : t ‑> Core_kernel__.Import.int
val to_int_ms : t ‑> Core_kernel__.Import.int
val to_int_sec : t ‑> Core_kernel__.Import.int
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 ‑> Core_kernel__.Import.float ‑> t
val scale_int : t ‑> Core_kernel__.Import.int ‑> t

overflows silently

val scale_int63 : t ‑> Core_kernel__.Std_internal.Int63.t ‑> t

overflows silently

val div : t ‑> t ‑> Core_kernel__.Std_internal.Int63.t
val (/) : t ‑> Core_kernel__.Import.float ‑> t
val (//) : t ‑> t ‑> Core_kernel__.Import.float
val create : ?sign:Core_kernel.Sign.t ‑> ?day:Core_kernel__.Import.int ‑> ?hr:Core_kernel__.Import.int ‑> ?min:Core_kernel__.Import.int ‑> ?sec:Core_kernel__.Import.int ‑> ?ms:Core_kernel__.Import.int ‑> ?us:Core_kernel__.Import.int ‑> ?ns:Core_kernel__.Import.int ‑> Core_kernel__.Import.unit ‑> t

Overflows silently.

module Parts : sig ... end

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__.Std_internal.Robustly_comparable with type t := t
type 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__.Std_internal.Int63.t

Fast, implemented as the identity function.

val of_int63_ns : Core_kernel__.Std_internal.Int63.t ‑> t

Fast, implemented as the identity function.

val to_int_ns : t ‑> Core_kernel__.Import.int

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

val of_int_ns : Core_kernel__.Import.int ‑> t
val to_proportional_float : t ‑> Core_kernel__.Import.float

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 : Core_kernel__.Import.unit ‑> t
val random : ?state:Core_kernel__.Std_internal.Random.State.t ‑> Core_kernel__.Import.unit ‑> t
module Alternate_sexp : sig ... end

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