Skip to content

Commit

Permalink
Simplify latency calc
Browse files Browse the repository at this point in the history
  • Loading branch information
dvsku committed Jun 15, 2024
1 parent e8022c5 commit 2b61bc7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/libnetwrk/net/messages/message.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>(milliseconds_t(head.send_timestamp) - milliseconds_t(timestamp));
return milliseconds_t(timestamp - head.send_timestamp);
}

template <typename T>
Expand Down

0 comments on commit 2b61bc7

Please sign in to comment.