GetTimePast returns the [earliest, latest] PHC-domain window corresponding to a past CLOCK_REALTIME timestamp (e.g. a kernel SO_TIMESTAMPING software TX timestamp). ts must come from the same host. v2-only. If ts is older than the last GM sync, the window is error_bound only (no holdover term), so
(ts time.Time)
| 111 | // If ts is older than the last GM sync, the window is error_bound only (no |
| 112 | // holdover term), so it can look surprisingly tight for an old ts. |
| 113 | func (f *FBClock) GetTimePast(ts time.Time) (*TrueTime, error) { |
| 114 | tt := &C.fbclock_truetime{} |
| 115 | errCode := C.fbclock_gettime_past(f.cFBClock, C.int64_t(ts.UnixNano()), tt) |
| 116 | if errCode != 0 { |
| 117 | return nil, fmt.Errorf("reading FBClock TrueTime past: %s", strerror(errCode)) |
| 118 | } |
| 119 | return &TrueTime{ |
| 120 | Earliest: time.Unix(0, int64(tt.earliest_ns)), |
| 121 | Latest: time.Unix(0, int64(tt.latest_ns)), |
| 122 | }, nil |
| 123 | } |
| 124 | |
| 125 | // GetTimePastUTC is GetTimePast but returns UTC-adjusted values. |
| 126 | func (f *FBClock) GetTimePastUTC(ts time.Time) (*TrueTime, error) { |