diff options
Diffstat (limited to 'src/testlib/qbenchmarkmeasurement.cpp')
-rw-r--r-- | src/testlib/qbenchmarkmeasurement.cpp | 35 |
1 files changed, 7 insertions, 28 deletions
diff --git a/src/testlib/qbenchmarkmeasurement.cpp b/src/testlib/qbenchmarkmeasurement.cpp index 799eb06add..99d5b1dd4f 100644 --- a/src/testlib/qbenchmarkmeasurement.cpp +++ b/src/testlib/qbenchmarkmeasurement.cpp @@ -16,19 +16,14 @@ void QBenchmarkTimeMeasurer::start() time.start(); } -qint64 QBenchmarkTimeMeasurer::checkpoint() +QList<QBenchmarkMeasurerBase::Measurement> QBenchmarkTimeMeasurer::stop() { - return time.elapsed(); + return { { qreal(time.elapsed()), QTest::WalltimeMilliseconds } }; } -qint64 QBenchmarkTimeMeasurer::stop() +bool QBenchmarkTimeMeasurer::isMeasurementAccepted(Measurement measurement) { - return time.elapsed(); -} - -bool QBenchmarkTimeMeasurer::isMeasurementAccepted(qint64 measurement) -{ - return (measurement > 50); + return (measurement.value > 50); } int QBenchmarkTimeMeasurer::adjustIterationCount(int suggestion) @@ -46,11 +41,6 @@ int QBenchmarkTimeMeasurer::adjustMedianCount(int) return 1; } -QTest::QBenchmarkMetric QBenchmarkTimeMeasurer::metricType() -{ - return QTest::WalltimeMilliseconds; -} - #ifdef HAVE_TICK_COUNTER // defined in 3rdparty/cycle_p.h void QBenchmarkTickMeasurer::start() @@ -58,19 +48,13 @@ void QBenchmarkTickMeasurer::start() startTicks = getticks(); } -qint64 QBenchmarkTickMeasurer::checkpoint() +QList<QBenchmarkMeasurerBase::Measurement> QBenchmarkTickMeasurer::stop() { CycleCounterTicks now = getticks(); - return qRound64(elapsed(now, startTicks)); + return { { elapsed(now, startTicks), QTest::CPUTicks } }; } -qint64 QBenchmarkTickMeasurer::stop() -{ - CycleCounterTicks now = getticks(); - return qRound64(elapsed(now, startTicks)); -} - -bool QBenchmarkTickMeasurer::isMeasurementAccepted(qint64) +bool QBenchmarkTickMeasurer::isMeasurementAccepted(QBenchmarkMeasurerBase::Measurement) { return true; } @@ -90,11 +74,6 @@ bool QBenchmarkTickMeasurer::needsWarmupIteration() return true; } -QTest::QBenchmarkMetric QBenchmarkTickMeasurer::metricType() -{ - return QTest::CPUTicks; -} - #endif |