mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 16:23:39 +02:00
Revert change to chrono<system_clock> for usecTimestampNow()
This commit is contained in:
parent
9628615c44
commit
80b7e04bc6
1 changed files with 3 additions and 8 deletions
|
@ -128,15 +128,11 @@ void usecTimestampNowForceClockSkew(qint64 clockSkew) {
|
|||
::usecTimestampNowAdjust = clockSkew;
|
||||
}
|
||||
|
||||
//static std::atomic<qint64> TIME_REFERENCE { 0 }; // in usec
|
||||
//static std::once_flag usecTimestampNowIsInitialized;
|
||||
//static QElapsedTimer timestampTimer;
|
||||
static std::atomic<qint64> TIME_REFERENCE { 0 }; // in usec
|
||||
static std::once_flag usecTimestampNowIsInitialized;
|
||||
static QElapsedTimer timestampTimer;
|
||||
|
||||
quint64 usecTimestampNow(bool wantDebug) {
|
||||
using namespace std::chrono;
|
||||
static const auto unixEpoch = system_clock::from_time_t(0);
|
||||
return duration_cast<microseconds>(system_clock::now() - unixEpoch).count();
|
||||
#if 0
|
||||
std::call_once(usecTimestampNowIsInitialized, [&] {
|
||||
TIME_REFERENCE = QDateTime::currentMSecsSinceEpoch() * USECS_PER_MSEC; // ms to usec
|
||||
timestampTimer.start();
|
||||
|
@ -208,7 +204,6 @@ quint64 usecTimestampNow(bool wantDebug) {
|
|||
}
|
||||
|
||||
return now;
|
||||
#endif
|
||||
}
|
||||
|
||||
float secTimestampNow() {
|
||||
|
|
Loading…
Reference in a new issue