Re: [chrony-users] Is there any timer or sleep function in linux that is not influenced by chrony?

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-users Archives ]


On Tue, Sep 05, 2017 at 12:12:32PM +0800, xxhdx1985126 wrote:
> I need to make a thread sleep for some amount of time which is influenced by "chrony's speeding up the system clock", is there any way?

Linux provides the CLOCK_MONOTONIC_RAW clock, which is not influenced
by the chronyd's adjustments of the CLOCK_REALTIME/CLOCK_MONOTONIC
clock.

Unfortunately, it cannot be used in clock_nanosleep() or in a timer.
You would need to make your own timer using clock_gettime() and a busy
loop or sleep in short intervals with another clock.

-- 
Miroslav Lichvar

-- 
To unsubscribe email chrony-users-request@xxxxxxxxxxxxxxxxxxxx 
with "unsubscribe" in the subject.
For help email chrony-users-request@xxxxxxxxxxxxxxxxxxxx 
with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/