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
]
- To: chrony-users@xxxxxxxxxxxxxxxxxxxx
- Subject: Re: [chrony-users] Is there any timer or sleep function in linux that is not influenced by chrony?
- From: Miroslav Lichvar <mlichvar@xxxxxxxxxx>
- Date: Mon, 11 Sep 2017 11:17:29 +0200
- Authentication-results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=mlichvar@xxxxxxxxxx
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 25FEE22C8D1
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.