VNC-151 Simplify timeval diff calculation

This commit is contained in:
El 2026-04-22 09:52:54 +00:00
parent 6bc7de499d
commit d60e86ef73
No known key found for this signature in database
GPG key ID: EB3F4C9EA29CDE59

View file

@ -556,8 +556,7 @@ namespace rfb {
unsigned diff = (second->tv_sec - first->tv_sec) * 1000;
if constexpr (std::is_same_v<T, timeval>) {
diff += second->tv_usec / 1000;
diff -= first->tv_usec / 1000;
diff += (second->tv_usec - first->tv_usec) / 1000;
} else {
diff += (second->tv_nsec - first->tv_nsec) / 1000000;
}