Note gettimeofday(2) for second handling should use clock_gettime(2).
gettimeofday(2) is vulnerable to issues around time changes (DST, leap seconds, other clock resets) that could cause strange behavior. clock_gettime with CLOCK_MONOTONIC will give more accurate time deltas, and should be used instead. (clock_gettime is not available on OSX, and possibly other OSs, so it should be wrapped.)
Loading
Please sign in to comment