package async_unix

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
include module type of struct include Core.Time_ns end
include sig ... end
val typerep_of_t : t Typerep_lib.Std.Typerep.t
val typename_of_t : t Typerep_lib.Std.Typename.t
module Span = Core.Time_ns.Span
module Option = Core.Time_ns.Option

Option.t is like t option, except that the value is immediate. This module should mainly be used to avoid allocations.

module Ofday = Core.Time_ns.Ofday
include Core_kernel.Identifiable with type t := t
include sig ... end
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_of_sexp : Sexplib.Sexp.t -> t
val sexp_of_t : t -> Sexplib.Sexp.t
include Base.Stringable.S with type t := t
val of_string : string -> t
val to_string : t -> string
include Core_kernel.Comparable.S_binable with type t := t
include Base.Comparable_intf.S with type t := t
include Base.Comparable_intf.Polymorphic_compare with type t := t
include Base.Polymorphic_compare_intf.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
val equal : t -> t -> bool
val compare : t -> t -> int

-1 means "less than", 0 means "equal", 1 means "greater than", and other values should not be returned

val min : t -> t -> t
val max : t -> t -> t
val ascending : t -> t -> int

ascending is identical to compare. descending x y = ascending y x. These are intended to be mnemonic when used like List.sort ~cmp:ascending and List.sort ~cmp:descending, since they cause the list to be sorted in ascending or descending order, respectively.

val descending : t -> t -> int
val between : t -> low:t -> high:t -> bool
val clamp_exn : t -> min:t -> max:t -> t

clamp_exn t ~min ~max returns t', the closest value to t such that between t' ~low:min ~high:max is true.

Raises if not (min <= max).

val clamp : t -> min:t -> max:t -> t Base.Or_error.t
include Base.Comparator.S with type t := t
type comparator_witness = Core.Time_ns.comparator_witness
include Base.Comparable_intf.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
module Replace_polymorphic_compare = Core.Time_ns.Replace_polymorphic_compare
module Map = Core.Time_ns.Map
module Set = Core.Time_ns.Set
include Core_kernel.Hashable.S_binable with type t := t
val hash : t -> Base.Int.t
module Table = Core.Time_ns.Table
module Hash_set = Core.Time_ns.Hash_set
module Hash_queue = Core.Time_ns.Hash_queue
include Base.Pretty_printer.S with type t := t
val pp : Caml.Format.formatter -> t -> unit
module Zone = Core.Time_ns.Zone
val epoch : t

Unix epoch (1970-01-01 00:00:00 UTC)

val min_value : t
val max_value : t
val add : t -> Span.t -> t

overflows silently

val sub : t -> Span.t -> t

overflows silently

val diff : t -> t -> Span.t

overflows silently

val abs_diff : t -> t -> Span.t

overflows silently

val to_span_since_epoch : t -> Span.t
val of_span_since_epoch : Span.t -> t
val to_time : t -> Core_kernel.Time.t
val of_time : Core_kernel.Time.t -> t

not injective (rounds to nearest microsecond)

val to_string_fix_proto : [ `Utc | `Local ] -> t -> string
val of_string_fix_proto : [ `Utc | `Local ] -> string -> t
val to_string_abs : t -> zone:Core_kernel.Time.Zone.t -> string

See Time for documentation.

val of_string_abs : string -> t
val to_sec_string : t -> zone:Zone.t -> string
val to_int63_ns_since_epoch : t -> Core_kernel.Int63.t
val of_int63_ns_since_epoch : Core_kernel.Int63.t -> t
val to_int_ns_since_epoch : t -> int

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

val of_int_ns_since_epoch : int -> t
val to_filename_string : t -> zone:Zone.t -> string

See Time for documentation

val of_filename_string : string -> zone:Zone.t -> t
val next_multiple : ?can_equal_after:bool -> base:t -> after:t -> interval:Span.t -> unit -> t

See Core_kernel.Time_ns.

Overflows silently.

val of_date_ofday : zone:Zone.t -> Core_kernel.Date.t -> Ofday.t -> t
val to_ofday : t -> zone:Zone.t -> Ofday.t
val to_date : t -> zone:Zone.t -> Core_kernel.Date.t
val to_date_ofday : t -> zone:Zone.t -> Core_kernel.Date.t * Ofday.t
val occurrence : [ `First_after_or_at | `Last_before_or_at ] -> t -> ofday:Ofday.t -> zone:Core_kernel.Time.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.Nothing.t

pause_forever sleeps indefinitely.

module Stable = Core.Time_ns.Stable
val random : ?state:Core_kernel.Random.State.t -> unit -> t
val now : unit -> t
  • deprecated [since 2016-02] Use [Time_source]
OCaml

Innovation. Community. Security.