[Linuxptp-users] clock_gettime() and clock_id
PTP IEEE 1588 stack for Linux
Brought to you by:
rcochran
From: Nemo C. <nem...@gm...> - 2022-10-27 20:04:12
|
Hi All, Can you please clarify few of my questions on getting the system time synchronized by ptp? I am running ptp4l service as the slave in the system that I understand it synchronizes the phc (hw clock) to the GMC. I am also running phc2sys which synchronizes the system time to the phc clock that is being synchronized by ptp4l. Now my application needs to use the system time that uses PTP timescale, not UTC.. I figured out I should be using clock_gettime(). But confused with different clock ids we have - CLOCK_MONOTONIC, CLOCK_REALTIME, CLOCK_MONOTONIC_RAW, CLOCK_REALTIME_COARSE, CLOCK_MONOTONIC_COARSE, CLOCK_REALTIME_ALARM, CLOCK_TAI etc. Please help me understand the differences? Thank you in advance! |