MCPcopy Create free account
hub / github.com/facebook/time / MaxFreqPPB

Function MaxFreqPPB

clock/clock.go:101–113  ·  view source on GitHub ↗

MaxFreqPPB returns maximum frequency adjustment supported by the clock

(clockid int32)

Source from the content-addressed store, hash-verified

99
100// MaxFreqPPB returns maximum frequency adjustment supported by the clock
101func MaxFreqPPB(clockid int32) (freqPPB float64, state int, err error) {
102 tx := &unix.Timex{}
103 state, err = unix.ClockAdjtime(clockid, tx)
104 if err != nil {
105 return 0.0, state, err
106 }
107 // man(2) clock_adjtime
108 freqPPB = float64(tx.Tolerance) / PPBToTimexPPM
109 if freqPPB == 0 {
110 freqPPB = 500000
111 }
112 return freqPPB, state, nil
113}
114
115// SetSync sets clock status to TIME_OK
116func SetSync(clockid int32) error {

Callers 3

MaxFreqPPBMethod · 0.92
TestMaxFreqPPBFunction · 0.85

Calls 1

ClockAdjtimeFunction · 0.92

Tested by 2

TestMaxFreqPPBFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…