Hacker News new | ask | show | jobs
by AnIdiotOnTheNet 1234 days ago
Almost every discussion I've ever seen regarding the use of CLOCK_MONOTONIC_RAW vs CLOCK_MONOTONIC has come down on the side of using CLOCK_MONOTONIC.

As I understanding it, when you're measuring real actual time you want the adjustments because otherwise you'll end up less accurate.

CLOCK_MONOTONIC_RAW is useful if you expect to use some other synchronization.

1 comments

Beware, while CLOCK_MONOTONIC_RAW has its uses (avoiding clock skew due to NTP when you're synchronising to an external clock) wasn't vDSO'd yet and was slow AF (and causing a syscall...). It's been optimized on later kernels but I was on some RH or LTS branch I was badly bitten by this.