Commit 2e5fcb2
committed
get_time_in_ns: switch to CLOCK_MONOTONIC
(previously TIME_UTC corresponed with CLOCK_REALTIME)
The function is intended to measure intervals rather to wall-clock time,
so that CLOCK_MONOTONIC is more eligible - if there is a clock jump
caused by clock_settime, it may cause problems. Even until now, this
was not much likely, anyways, because this would happen just when an
administrator sets the time with clock_settime. NTP adjusts the time
gradually and never jumps back (see ntp_adjtime()) and it also adjusts
both clocks at the same time, anyways (the clock is actually one,
REALTIME is adding an fixed offset). Not sure about Windows (where the
clock_getime API is provided by MinGW, not the system iteslf).1 parent 8e47060 commit 2e5fcb2
1 file changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
| 253 | + | |
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
260 | | - | |
| 259 | + | |
| 260 | + | |
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
0 commit comments