From 2b61bc736f2be8d95b80e9896d352656b4a3cffe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Stoj=C5=A1in?= Date: Sat, 15 Jun 2024 04:27:56 +0200 Subject: [PATCH] Simplify latency calc --- include/libnetwrk/net/messages/message.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/libnetwrk/net/messages/message.hpp b/include/libnetwrk/net/messages/message.hpp index c9bcf9e..87e0898 100644 --- a/include/libnetwrk/net/messages/message.hpp +++ b/include/libnetwrk/net/messages/message.hpp @@ -52,7 +52,7 @@ namespace libnetwrk { Get milliseconds it took from receiving the message to a relative timestamp. */ milliseconds_t latency(uint64_t timestamp) { - return std::chrono::duration_cast(milliseconds_t(head.send_timestamp) - milliseconds_t(timestamp)); + return milliseconds_t(timestamp - head.send_timestamp); } template