aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2024-07-05 13:48:14 +0200
committerPierre Ossman <ossman@cendio.se>2024-07-05 13:48:14 +0200
commitc831c9084afffdf10fa5dda865a6df5d643d83dd (patch)
treefd2aa88f352a4c9b4310c00d7208a000031d1154 /common
parent80ce950887824a120c8de07dac9191e7fff72de4 (diff)
downloadtigervnc-c831c9084afffdf10fa5dda865a6df5d643d83dd.tar.gz
tigervnc-c831c9084afffdf10fa5dda865a6df5d643d83dd.zip
Round up expiration time for timers
Otherwise we won't properly guarantee that we'll wait *at least* as long as the specified time.
Diffstat (limited to 'common')
-rw-r--r--common/rfb/Timer.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/rfb/Timer.cxx b/common/rfb/Timer.cxx
index 5216c7e3..4654d50c 100644
--- a/common/rfb/Timer.cxx
+++ b/common/rfb/Timer.cxx
@@ -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;