How to make a C timer expire at a particular system time in Linux
I was trying to create a timer that depends on the system clock. That means when the system time changes it should affect the expiry of this timer too. So I thought, creating a timer based on CLOCK_REALTIME should do the trick. But when this timer is armed to expire after 60 sec and when I advanced the system clock by 32 sec (using date command), the timer expired exactly after 60 sec. It didn't expire 32 sec earlier. So I calculated the time elapsed for CLOCK_REALTIME and CLOCK_MONOTONIC clocks between the 2 timer expiry. It showed 92 secs for CLOCK_REALTIME and 60 sec for CLOCK_MONOTONIC,