mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
output difference in time since last send for debug
This commit is contained in:
parent
8035471fa4
commit
0cfc2dae52
1 changed files with 4 additions and 0 deletions
|
@ -144,6 +144,7 @@ void *send_buffer_thread(void *args)
|
|||
int sentBytes;
|
||||
int currentFrame = 1;
|
||||
timeval startTime;
|
||||
timeval lastSend;
|
||||
timeval now;
|
||||
|
||||
int16_t *clientMix = new int16_t[BUFFER_LENGTH_SAMPLES];
|
||||
|
@ -157,6 +158,8 @@ void *send_buffer_thread(void *args)
|
|||
while (usecTimestamp(&startTime, (currentFrame * BUFFER_SEND_INTERVAL_USECS)) <= usecTimestamp(&now)) {
|
||||
sentBytes = 0;
|
||||
|
||||
std::cout << "The difference was " << diffclock(lastSend, now) << "ms.\n";
|
||||
|
||||
int sampleOffset = ((currentFrame - 1) * BUFFER_LENGTH_SAMPLES) % whiteNoiseLength;
|
||||
|
||||
memcpy(masterMix, whiteNoiseBuffer + sampleOffset, BUFFER_LENGTH_BYTES);
|
||||
|
@ -193,6 +196,7 @@ void *send_buffer_thread(void *args)
|
|||
}
|
||||
}
|
||||
|
||||
gettimeofday(&lastSend, NULL);
|
||||
currentFrame++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue