我一直在寻找这个问题的答案,但还没有明确的文档。
来自手册页说它受到NTP执行的增量调整CLOCK_MONOTONIC的影响clock_gettimeadjtime
时钟单调
Run Code Online (Sandbox Code Playgroud)Clock that cannot be set and represents monotonic time since some unspecified starting point. This clock is not affected by discontinuous jumps in the system time (e.g., if the system administrator manually changes the clock), but is affected by the incremental adjustments performed by adjtime(3) and NTP
我不清楚的是它是受到NTP所做的各种调整的影响还是只是小调整的影响?
假设 NTP 发生较大的时间跳跃,如果系统偏离时钟,会CLOCK_MONOTONIC反映出来吗?
我不确定 NTP 使用以下哪个系统调用来调整我的 Cent OS 系统上的时间
快速测试表明,尽管 NTP 使系统跳跃了 10 个小时,但单调时钟输出没有变化。
即使通过调用使时间跳跃clock_settime也不会影响单调时间