Time returns time from the PTP device using the clock_gettime syscall
()
| 46 | |
| 47 | // Time returns time from the PTP device using the clock_gettime syscall |
| 48 | func (dev *Device) Time() (time.Time, error) { |
| 49 | var ts unix.Timespec |
| 50 | if err := unix.ClockGettime(dev.ClockID(), &ts); err != nil { |
| 51 | return time.Time{}, fmt.Errorf("failed clock_gettime: %w", err) |
| 52 | } |
| 53 | return time.Unix(ts.Unix()), nil |
| 54 | } |
| 55 | |
| 56 | // ReadSysoffExtended reads the precise time from the PHC along with SYS time to measure the call delay. |
| 57 | // The nsamples parameter is set to ExtendedNumProbes. |
nothing calls this directly
no test coverage detected