mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2026-07-17 16:36:49 +00:00
VNC-151 Simplify timeval diff calculation
This commit is contained in:
parent
6bc7de499d
commit
d60e86ef73
1 changed files with 1 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue