change DATA_SEND_INTERVAL_MSECS to DATA_SEND_INTERVAL_USECS

This commit is contained in:
Stephen Birarda 2013-08-05 10:30:56 -07:00
parent 1f8031770b
commit d51e0b59bd

View file

@ -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);
} }
} }