Re:gettimeofday() should never be used to measure time
by hmpc on Wednesday January 21, 2015 @11:30AM
(#8923791)
Unless I misunderstood, that's what the TIMER_ABSTIME option is for. This is actually what I use for soft real-time loops, when I'm concerned about both drift and jitter.
[ Parent
| on HN ]
Re:gettimeofday() should never be used to measure time
by JoeAltmaier on Wednesday January 21, 2015 @10:50PM
(#8927444)
Ok thanks, I reread it, that seems to be the case! I hope the seconds field is honored along with ns. WinCE had a bug where they used a long. If latency made your call for a small interval occur after the interval had elapsed, you slept for 19.5 minutes instead (nearly a full count). Combining the ns with a second counter should be enough bits to avoid that.