clock

package
v0.9.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2022 License: Apache-2.0, BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNTPQueryFailed = errors.New("NTP query failed")

ErrNTPQueryFailed is returned if an NTP query failed.

Functions

func FetchTimeOffset

func FetchTimeOffset(host string) error

FetchTimeOffset establishes the difference in local vs network time. This difference is stored in offset so that it can be used to adjust the local clock.

func Since

func Since(t time.Time) time.Duration

Since returns the time elapsed since t. It is shorthand for clock.SyncedTime().Sub(t).

func SyncedTime

func SyncedTime() time.Time

SyncedTime gets the synchronized time (according to the network) of a node.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL