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

Method GetTimeUTC

fbclock/fbclock.go:94–105  ·  view source on GitHub ↗

GetTimeUTC returns TrueTime in UTC

()

Source from the content-addressed store, hash-verified

92
93// GetTimeUTC returns TrueTime in UTC
94func (f *FBClock) GetTimeUTC() (*TrueTime, error) {
95 tt := &C.fbclock_truetime{}
96 errCode := C.fbclock_gettime_utc(f.cFBClock, tt)
97 if errCode != 0 {
98 return nil, fmt.Errorf("reading FBClock TrueTime UTC: %s", strerror(errCode))
99 }
100
101 earliest := time.Unix(0, int64(tt.earliest_ns))
102 latest := time.Unix(0, int64(tt.latest_ns))
103
104 return &TrueTime{Earliest: earliest, Latest: latest}, nil
105}
106
107// GetTimePast returns the [earliest, latest] PHC-domain window corresponding
108// to a past CLOCK_REALTIME timestamp (e.g. a kernel SO_TIMESTAMPING software

Callers 1

fbclockRunFunction · 0.45

Calls 2

strerrorFunction · 0.85
UnixMethod · 0.80

Tested by

no test coverage detected