mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 21:23:18 +02:00
Use system_clock in usecTimestampNow for cross-platform goodness
This commit is contained in:
parent
b45b0f54e4
commit
33db1394e6
1 changed files with 2 additions and 1 deletions
|
@ -134,7 +134,8 @@ void usecTimestampNowForceClockSkew(qint64 clockSkew) {
|
|||
|
||||
quint64 usecTimestampNow(bool wantDebug) {
|
||||
using namespace std::chrono;
|
||||
return duration_cast<microseconds>(high_resolution_clock::now().time_since_epoch()).count();
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue