clock

package
v0.7.6 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2021 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 added in v0.4.0

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