mirror of
https://github.com/prometheus/node_exporter.git
synced 2025-08-20 18:33:52 -07:00
21 lines
641 B
Markdown
21 lines
641 B
Markdown
[](https://travis-ci.org/beevik/ntp)
|
|
[](https://godoc.org/github.com/beevik/ntp)
|
|
|
|
ntp
|
|
===
|
|
|
|
The ntp package is an implementation of a simple NTP client. It allows you
|
|
to connect to a remote NTP server and request the current time.
|
|
|
|
To request the current time using version 4 of the NTP protocol, simply do the
|
|
following:
|
|
```go
|
|
time, err := ntp.Time("0.pool.ntp.org")
|
|
```
|
|
|
|
To request the current time along with additional metadata, use the Query
|
|
function:
|
|
```go
|
|
response, err := ntp.Query("0.pool.ntp.org", 4)
|
|
```
|