Invoke ping callback only if a new ping value has been added.
This commit is contained in:
@@ -77,14 +77,17 @@ public:
|
||||
void StartPing() {
|
||||
pingTimer.start();
|
||||
}
|
||||
void EndPing() {
|
||||
bool EndPing() {
|
||||
bool retVal = false;
|
||||
if (pingTimer.is_running()) {
|
||||
pingValues.push_back((unsigned)pingTimer.elapsed().total_milliseconds());
|
||||
if (pingValues.size() > SIZE_PING_BACKLOG) {
|
||||
pingValues.pop_front();
|
||||
}
|
||||
pingTimer.reset();
|
||||
retVal = true;
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user