module Time_ns:sig
..end
float
-based Time
,
but representing a narrower range of times.
This module represents absolute times with nanosecond precision, approximately between the years 1823 and 2116 CE.
NOTE: you should normally default to using Time
instead of this module. The
reasons are:
Time.t
values, so it will likely be
much more convenient for you.Time.t
and the other half expecting
Time_ns.t
.Time_ns.t
in certain cases:
int
s rather than float
s internally, which makes certain things easier to
reason about, since ints respect a bunch of arithmetic identities that floats don't,
e.g., x + (y + z) = (x + y) + z
.Time_ns.t
to begin with, but
we're unlikely to flip everything to Time_ns.t
in the short term (see comment at
the end of time_ns.ml).typet =
Core_kernel.Time_ns.t
val typerep_of_t : t Typerep_lib.Std.Typerep.t
val typename_of_t : t Typerep_lib.Std.Typename.t
module Span:sig
..end
module Option:sig
..end
with type time := t
module Ofday:sig
..end
with type time := t
include Identifiable
val epoch : t
val min_value : t
val max_value : t
val now : unit -> t
val add : t -> Span.t -> t
val sub : t -> Span.t -> t
val diff : t -> t -> Span.t
val abs_diff : t -> t -> Span.t
val to_span_since_epoch : t -> Span.t
val of_span_since_epoch : Span.t -> t
val to_time : t -> Time.t
val of_time : Time.t -> t
val to_string_fix_proto : [ `Local | `Utc ] -> t -> string
val of_string_fix_proto : [ `Local | `Utc ] -> string -> t
val to_int63_ns_since_epoch : t -> Core_kernel.Std.Int63.t
val of_int63_ns_since_epoch : Core_kernel.Std.Int63.t -> t
val to_int_ns_since_epoch : t -> int
to_int63_ns_since_epoch
instead.val of_int_ns_since_epoch : int -> t
val next_multiple : ?can_equal_after:bool ->
base:t ->
after:t -> interval:Span.t -> unit -> t
Core_kernel.Time_ns
val of_date_ofday : zone:Zone.t -> Date.t -> Ofday.t -> t
val to_date : t -> zone:Zone.t -> Date.t
val occurrence : [ `First_after_or_at | `Last_before_or_at ] ->
t -> ofday:Ofday.t -> zone:Zone.t -> t
val pause : Span.t -> unit
pause span
sleeps for span
time.val interruptible_pause : Span.t -> [ `Ok | `Remaining of Span.t ]
interruptible_pause span
sleeps for span
time unless interrupted (e.g. by delivery
of a signal), in which case the remaining unslept portion of time is returned.val pause_forever : unit -> Core_kernel.Std.never_returns
pause_forever
sleeps indefinitely.module Stable:sig
..end
val random : unit -> t