add seconds since last ping print

This commit is contained in:
Lion Kortlepel 2021-02-17 13:05:18 +01:00 committed by Anonymous275
parent 32038046d5
commit 84252e892e

View File

@ -75,7 +75,9 @@ void TClient::UpdatePingTime() {
mLastPingTime = std::chrono::high_resolution_clock::now();
}
int TClient::SecondsSinceLastPing() {
return std::chrono::duration_cast<std::chrono::seconds>(
auto seconds = std::chrono::duration_cast<std::chrono::seconds>(
std::chrono::high_resolution_clock::now() - mLastPingTime)
.count();
.count();
debug("ping time for " + GetName() + ": " + std::to_string(seconds));
return seconds;
}