mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-02-17 13:02:49 -05:00
Use QElapsedTimer everywhere.
This commit is contained in:
parent
9882f16614
commit
460b23b1eb
@ -23,11 +23,7 @@
|
||||
#include <QLocale>
|
||||
#include <QStringList>
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
|
||||
#include <QElapsedTimer>
|
||||
#else
|
||||
#include <QTime>
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include <windows.h> // for Sleep()
|
||||
@ -177,11 +173,7 @@ void wait(int ms)
|
||||
return;
|
||||
}
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
|
||||
QElapsedTimer timer;
|
||||
#else
|
||||
QTime timer;
|
||||
#endif
|
||||
timer.start();
|
||||
|
||||
if (ms <= 50) {
|
||||
@ -196,7 +188,7 @@ void wait(int ms)
|
||||
QCoreApplication::processEvents(QEventLoop::AllEvents, timeLeft);
|
||||
sleep(10);
|
||||
}
|
||||
} while (timer.elapsed() < ms);
|
||||
} while (!timer.hasExpired(ms));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include "CompositeKey_p.h"
|
||||
|
||||
#include <QtConcurrent>
|
||||
#include <QTime>
|
||||
#include <QElapsedTimer>
|
||||
|
||||
#include "crypto/CryptoHash.h"
|
||||
#include "crypto/SymmetricCipher.h"
|
||||
@ -182,7 +182,7 @@ void TransformKeyBenchmarkThread::run()
|
||||
SymmetricCipher::Encrypt);
|
||||
cipher.init(seed, iv);
|
||||
|
||||
QTime t;
|
||||
QElapsedTimer t;
|
||||
t.start();
|
||||
|
||||
do {
|
||||
@ -191,5 +191,5 @@ void TransformKeyBenchmarkThread::run()
|
||||
return;
|
||||
}
|
||||
m_rounds += 10000;
|
||||
} while (t.elapsed() < m_msec);
|
||||
} while (!t.hasExpired(m_msec));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user