GetTimeUTC returns TrueTime in UTC
()
| 92 | |
| 93 | // GetTimeUTC returns TrueTime in UTC |
| 94 | func (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 |
no test coverage detected