On Mon, Jan 15, 2024 at 01:05:32PM +0700, James Clark wrote: > I have implemented refclock SOCK for a project I'm working on. In my case, > I am getting samples from a PHC, so I have a system time with nanosecond > precision (from PTP_SYS_OFFSET*). But refclock SOCK uses struct timeval, > which is in microseconds. I looked at the refclock_sock servo in linuxptp > 4.x, and that just discards away the fraction of the microsecond. But > that's not very satisfying and makes chronyc give misleading information > about the accuracy of the offset.
The resolution of the timestamp is not very important. Milliseconds would be still fine. It is not used for calculating the offset. The offset is provided directly as a floating-point value in the SOCK message. This is different from the SHM refclock, where the offset needs to be calculated by the receiver as a difference between two timestamps and where an extension was required to improve the resolution to nanoseconds. -- Miroslav Lichvar -- To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org with "unsubscribe" in the subject. For help email chrony-users-requ...@chrony.tuxfamily.org with "help" in the subject. Trouble? Email listmas...@chrony.tuxfamily.org.