package core_extended

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Simple Network Time Protocol

val query : ?timeout:Core.Time.Span.t -> ?port:int -> string -> [ `Error of Core.Exn.t | `Timeout | `Offset of Core.Time.Span.t ]

query hostname returns the difference between the clock on the local host and the clock on the host specified by hostname.

If the remote host is down or not running an (S)NTP service this call will `Timeout. Other errors, including some classes of resolution or network will raise an exception, which will be returned as `Error.

type t = {
  1. remote_host : string;
  2. offset : Core.Time.Span.t;
  3. round_trip_delay : Core.Time.Span.t;
  4. stratum : int;
  5. root_delay : Core.Time.Span.t;
  6. root_dispersion : Core.Time.Span.t;
  7. t1 : float;
  8. t2 : float;
  9. t3 : float;
  10. t4 : float;
}
include sig ... end
val t_of_sexp : Sexplib.Sexp.t -> t
val sexp_of_t : t -> Sexplib.Sexp.t
val t4 : t -> float
val t3 : t -> float
val t2 : t -> float
val t1 : t -> float
val root_dispersion : t -> Core.Time.Span.t
val root_delay : t -> Core.Time.Span.t
val stratum : t -> int
val round_trip_delay : t -> Core.Time.Span.t
val offset : t -> Core.Time.Span.t
val remote_host : t -> string
module Fields : sig ... end
val extended_query : ?timeout:Core.Time.Span.t -> ?port:int -> string -> t Core.Or_error.t
OCaml

Innovation. Community. Security.