mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 17:10:45 +02:00
handle first packet stats better
This commit is contained in:
parent
8359ebb82f
commit
8c14f948f2
1 changed files with 19 additions and 14 deletions
|
@ -123,11 +123,15 @@ void runReceive(const char* addressOption, int port, int gap, int size) {
|
|||
return;
|
||||
}
|
||||
|
||||
quint64 last = usecTimestampNow();
|
||||
quint64 last = 0; // first case
|
||||
|
||||
while (true) {
|
||||
n = recvfrom(sockfd, inputBuffer, size, 0, NULL, NULL); // we don't care about where it came from
|
||||
|
||||
if (last == 0) {
|
||||
last = usecTimestampNow();
|
||||
std::cout << "first packet received\n";
|
||||
} else {
|
||||
quint64 now = usecTimestampNow();
|
||||
int actualGap = now - last;
|
||||
timeGaps.update(actualGap);
|
||||
|
@ -142,4 +146,5 @@ void runReceive(const char* addressOption, int port, int gap, int size) {
|
|||
last = now;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue