timesync

package
v0.0.23 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NTPSample

func NTPSample(t1, t2, t3, t4 time.Time) (offset, rtt time.Duration)

Types

type Tracker

type Tracker struct {
	// contains filtered or unexported fields
}

Tracker accumulates NTP samples and picks the best (minimum-RTT) offset. All methods are safe for concurrent use.

func (*Tracker) Add

func (t *Tracker) Add(offset, rtt time.Duration)

func (*Tracker) AvgRTT

func (t *Tracker) AvgRTT() time.Duration

func (*Tracker) Offset

func (t *Tracker) Offset() time.Duration

func (*Tracker) RTT

func (t *Tracker) RTT() time.Duration

Jump to

Keyboard shortcuts

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