Up

Module Span

Signature

include Core_kernel.Time_ns.Span
type t = private Core_kernel.Core_int63.t

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

val bin_read_t : t Bin_prot.Read.reader
val __bin_read_t__ : (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 typerep_of_t : t Typerep_lib.Std.Typerep.t
val typename_of_t : t Typerep_lib.Std.Typename.t
val compare : t -> t -> 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.With_zero with type t := t
type t
val validate_positive : t Core_kernel.Validate.check
val validate_non_negative : t Core_kernel.Validate.check
val validate_negative : t Core_kernel.Validate.check
val validate_non_positive : t Core_kernel.Validate.check
val is_positive : t -> bool
val is_non_negative : t -> bool
val is_negative : t -> bool
val is_non_positive : t -> bool
include Core_kernel.Equal.S with type t := t
type t
val equal : t 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 : float -> t
val of_us : float -> t
val of_ms : float -> t
val of_sec : float -> 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 of_sec_with_microsecond_precision : float -> t
val of_int_us : int -> t
val of_int_ms : int -> t
val of_int_sec : int -> t
val to_int_us : t -> int
val to_int_ms : t -> int
val to_int_sec : t -> 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.Std.Timing_wheel_float in particular. See also Core.Std.Time.

val max_value : t
val (+) : t -> t -> t
val (-) : t -> t -> t
val abs : t -> t
val neg : t -> t
val scale : t -> float -> t
val scale_int : t -> int -> t
val scale_int63 : t -> Core_kernel.Core_int63.t -> t
val div : t -> t -> Core_kernel.Core_int63.t
val (/) : t -> float -> t
val (//) : t -> t -> float
val create : ?sign:Core_kernel.Float.Sign.t -> ?day:int -> ?hr:int -> ?min:int -> ?sec:int -> ?ms:int -> ?us:int -> ?ns:int -> unit -> t
module Parts : sig .. end
Similar to Time.Span.Parts, but adding ns.
val to_parts : t -> Parts.t
val of_parts : Parts.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.Core_int63.t

Fast, implemented as the identity function.

Fast, implemented as the identity function.

val of_int63_ns : Core_kernel.Core_int63.t -> t

Fast, implemented as the identity function.

val to_int_ns : t -> int

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

val of_int_ns : int -> t
val since_unix_epoch : unit -> t
module Alternate_sexp : sig .. end
Note that we expose a sexp format that is not the one exposed in Core.
type t
val t_of_sexp : Sexplib.Sexp.t -> t
val sexp_of_t : t -> Sexplib.Sexp.t