mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 23:55:12 +02:00
change DATA_SEND_INTERVAL_MSECS to DATA_SEND_INTERVAL_USECS
This commit is contained in:
parent
1f8031770b
commit
d51e0b59bd
1 changed files with 2 additions and 2 deletions
|
@ -55,7 +55,7 @@ void Agent::run(QUrl scriptURL) {
|
||||||
timeval lastDomainServerCheckIn = {};
|
timeval lastDomainServerCheckIn = {};
|
||||||
int numMicrosecondsSleep = 0;
|
int numMicrosecondsSleep = 0;
|
||||||
|
|
||||||
const float DATA_SEND_INTERVAL_MSECS = (1 / 60) * 1000;
|
const float DATA_SEND_INTERVAL_USECS = (1 / 60) * 1000 * 1000;
|
||||||
|
|
||||||
sockaddr_in senderAddress;
|
sockaddr_in senderAddress;
|
||||||
unsigned char receivedData[MAX_PACKET_SIZE];
|
unsigned char receivedData[MAX_PACKET_SIZE];
|
||||||
|
@ -80,7 +80,7 @@ void Agent::run(QUrl scriptURL) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// sleep for the correct amount of time to have data send be consistently timed
|
// sleep for the correct amount of time to have data send be consistently timed
|
||||||
if ((numMicrosecondsSleep = (DATA_SEND_INTERVAL_MSECS * 1000) - (usecTimestampNow() - usecTimestamp(&thisSend))) > 0) {
|
if ((numMicrosecondsSleep = DATA_SEND_INTERVAL_USECS - (usecTimestampNow() - usecTimestamp(&thisSend))) > 0) {
|
||||||
usleep(numMicrosecondsSleep);
|
usleep(numMicrosecondsSleep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue