From 19059f306d1d8154bb330b7c428982baf6a964ec Mon Sep 17 00:00:00 2001 From: Morten Sorvig Date: Tue, 11 Aug 2009 13:20:17 +0200 Subject: Perform the variable initalizations _before_ starting the clock. Removes a few of cycles erronously included in the results. --- src/testlib/qbenchmark.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/testlib/qbenchmark.cpp b/src/testlib/qbenchmark.cpp index 42ce662..8a2cc44 100644 --- a/src/testlib/qbenchmark.cpp +++ b/src/testlib/qbenchmark.cpp @@ -192,16 +192,16 @@ void QBenchmarkTestMethodData::setResult(qint64 value) */ QTest::QBenchmarkIterationController::QBenchmarkIterationController(RunMode runMode) { - QTest::beginBenchmarkMeasurement(); i = 0; if (runMode == RunOnce) QBenchmarkTestMethodData::current->runOnce = true; + QTest::beginBenchmarkMeasurement(); } QTest::QBenchmarkIterationController::QBenchmarkIterationController() { - QTest::beginBenchmarkMeasurement(); i = 0; + QTest::beginBenchmarkMeasurement(); } /*! \internal -- cgit v0.12