mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-24 00:46:59 +00:00
add seconds since last ping print
This commit is contained in:
committed by
Anonymous275
parent
32038046d5
commit
84252e892e
@@ -75,7 +75,9 @@ void TClient::UpdatePingTime() {
|
|||||||
mLastPingTime = std::chrono::high_resolution_clock::now();
|
mLastPingTime = std::chrono::high_resolution_clock::now();
|
||||||
}
|
}
|
||||||
int TClient::SecondsSinceLastPing() {
|
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)
|
std::chrono::high_resolution_clock::now() - mLastPingTime)
|
||||||
.count();
|
.count();
|
||||||
|
debug("ping time for " + GetName() + ": " + std::to_string(seconds));
|
||||||
|
return seconds;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user