Skip to content

Commit

Permalink
Round up expiration time for timers
Browse files Browse the repository at this point in the history
Otherwise we won't properly guarantee that we'll wait *at least* as long
as the specified time.
  • Loading branch information
CendioOssman committed Jul 5, 2024
1 parent 80ce950 commit c831c90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common/rfb/Timer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ inline static timeval addMillis(timeval inTime, int millis) {
}

inline static int diffTimeMillis(timeval later, timeval earlier) {
return ((later.tv_sec - earlier.tv_sec) * 1000) + ((later.tv_usec - earlier.tv_usec) / 1000);
return ((later.tv_sec - earlier.tv_sec) * 1000) + ((later.tv_usec - earlier.tv_usec + 999) / 1000);
}

std::list<Timer*> Timer::pending;
Expand Down

0 comments on commit c831c90

Please sign in to comment.