summaryrefslogtreecommitdiffstats
path: root/src/testlib
diff options
context:
space:
mode:
Diffstat (limited to 'src/testlib')
-rw-r--r--src/testlib/qbenchmarkmeasurement_p.h4
-rw-r--r--src/testlib/qtestcase.cpp4
2 files changed, 5 insertions, 3 deletions
diff --git a/src/testlib/qbenchmarkmeasurement_p.h b/src/testlib/qbenchmarkmeasurement_p.h
index 932852c..20a3bc1 100644
--- a/src/testlib/qbenchmarkmeasurement_p.h
+++ b/src/testlib/qbenchmarkmeasurement_p.h
@@ -53,7 +53,7 @@
// We mean it.
//
-#include <QtCore/qdatetime.h>
+#include <QtCore/qelapsedtimer.h>
#include "3rdparty/cycle_p.h"
#include "qbenchmark.h"
@@ -87,7 +87,7 @@ public:
bool needsWarmupIteration();
QTest::QBenchmarkMetric metricType();
private:
- QTime time;
+ QElapsedTimer time;
};
#ifdef HAVE_TICK_COUNTER // defined in 3rdparty/cycle_p.h
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 5934850..aae2786 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -956,7 +956,9 @@ void seedRandom()
static bool randomSeeded = false;
if (!randomSeeded) {
if (!QTest::seedSet) {
- QTest::seed = QDateTime::currentDateTime().toTime_t();
+ QElapsedTimer timer;
+ timer.start();
+ QTest::seed = timer.msecsSinceReference();
}
qsrand(QTest::seed);
randomSeeded = true;