Closed snelg closed 3 years ago
Hmm, no, this doesn't work consistently
not sure, but i think we need to do something like the below, otherwise nsec will not be a valid value sometimes
total_time = (tv.sec*1e9 + tv.nsec) + wait_time_in_ns;
sec = total_time / ns_in_sec;
nsec = total_time % ns_in_sec;
alternatively:
tv.nsec += wait_time_in_ns;
if tv.nsec > 1e9:
tv.nsec -= 1e9
tv.sec++
Right, fixed the nsec overflow/wraparound.
Update for PR #45