Last touch to removing gettimeofday

This commit is contained in:
Atlante45 2014-04-21 16:44:21 -07:00
parent 0479aaba46
commit be2db49e08

View file

@ -20,6 +20,7 @@
#endif #endif
#include <QtCore/QDebug> #include <QtCore/QDebug>
#include <QDateTime>
#include "OctalCode.h" #include "OctalCode.h"
#include "SharedUtil.h" #include "SharedUtil.h"
@ -30,9 +31,8 @@ void usecTimestampNowForceClockSkew(int clockSkew) {
} }
quint64 usecTimestampNow() { quint64 usecTimestampNow() {
timeval now; qint64 msecSinceEpoch = QDateTime::currentMSecsSinceEpoch();
gettimeofday(&now, NULL); return msecSinceEpoch * 1000 + ::usecTimestampNowAdjust;
return (now.tv_sec * 1000000 + now.tv_usec) + ::usecTimestampNowAdjust;
} }
float randFloat() { float randFloat() {