Re:Determine durations with monotonic clocks if available
by hawk_ on Monday January 30, 2023 @05:57AM
(#34578178)
BTW on linux the equivalent is CLOCK_BOOTTIME - and the general point stands that you need to find something "steady" enough for your usecase. There is no absolutely monotonic clock in the universe ;-), that we know of, is there?
In reality there is no absolute way to guarantee that a particular clock source is steady; virtualization can easily wreck them, so an external verification is the only definitive solution. You can say that macOS `CLOCK_MONOTONIC` is more steady than Linux `CLOCK_MONOTONIC`, but you can never assume they are actually steady all the time; they are only steady enough for not causing issues in typical cases.