mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-16 10:40:13 +02:00
make sure sleep is never too long
This commit is contained in:
parent
aac6d409d2
commit
f94f535254
1 changed files with 1 additions and 1 deletions
|
@ -61,7 +61,7 @@ bool PacketSender::process() {
|
|||
uint64_t now = usecTimestampNow();
|
||||
// dynamically sleep until we need to fire off the next set of voxels
|
||||
uint64_t elapsed = now - _lastSendTime;
|
||||
int usecToSleep = SEND_INTERVAL_USECS - elapsed;
|
||||
int usecToSleep = std::max(SEND_INTERVAL_USECS, SEND_INTERVAL_USECS - elapsed);
|
||||
_lastSendTime = now;
|
||||
if (usecToSleep > 0) {
|
||||
usleep(usecToSleep);
|
||||
|
|
Loading…
Reference in a new issue