Module Core_extended.Sntp

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 = {
remote_host : string;
offset : Core.Time.Span.t;
round_trip_delay : Core.Time.Span.t;
stratum : int;
root_delay : Core.Time.Span.t;
root_dispersion : Core.Time.Span.t;
t1 : float;
t2 : float;
t3 : float;
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