fix incorrect timeout microsecond computation
This commit is contained in:
parent
6b127f9661
commit
7232feee5a
1 changed files with 2 additions and 1 deletions
|
@ -131,7 +131,8 @@ struct timeval *get_duration_to_next_timer_expiration()
|
|||
next_timer->expiration_time_ms_,
|
||||
next_timer->period_ms_);
|
||||
result.tv_sec = duration / 1000;
|
||||
result.tv_usec = 1000 * (duration - result.tv_sec);
|
||||
duration -= result.tv_sec * 1000;
|
||||
result.tv_usec = 1000 * duration;
|
||||
return &result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue