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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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