View Source sntp (util v1.1.5)

Implements SNTP query logic. SNTP - Simple Network Time Protocol (RFC-2030).

Link to this section Summary

Functions

Query NTP time sources from "/etc/ntp.conf" and return min/max/avg offset of current host from given time sources.

See also: avg_time/1.

Query ServerAddress NTP time sources and return min/max/avg offset of current host from given time sources.
Query ServerAddress time source to find out server time and current host's offset from time source.
Return a list of default NTP time servers for this host.
Return a list of default NTP time servers for this host. If Resolve is true, the list will contain IP addresses or else host names.

Link to this section Functions

-spec avg_time() -> {Min :: integer(), Max :: integer(), Avg :: integer()}.
Query NTP time sources from "/etc/ntp.conf" and return min/max/avg offset of current host from given time sources.

See also: avg_time/1.

Link to this function

avg_time(ServerAddresses)

View Source
-spec avg_time([inet:ip_address()]) -> {Min :: integer(), Max :: integer(), Avg :: integer()}.
Query ServerAddress NTP time sources and return min/max/avg offset of current host from given time sources.
-spec time(ServerAddress :: inet:ip_address()) -> #sntp{}.
Query ServerAddress time source to find out server time and current host's offset from time source.
-spec time_servers() -> [inet:ip_address()].
Return a list of default NTP time servers for this host.
-spec time_servers(boolean()) -> [inet:ip_address()].
Return a list of default NTP time servers for this host. If Resolve is true, the list will contain IP addresses or else host names.