diff options
author | Thomas Hartmann <Thomas.Hartmann@nokia.com> | 2009-08-10 15:07:31 (GMT) |
---|---|---|
committer | Thomas Hartmann <Thomas.Hartmann@nokia.com> | 2009-08-10 15:07:31 (GMT) |
commit | e67cd6560eea4e4b600d5e3586cd823347e101d2 (patch) | |
tree | 19e7a596b37c2da517b5d2d0dc0de4f7ee8f5b99 /src/testlib/qbenchmark.h | |
parent | 9a92aee8ff94a1b705e92f895831f9437762da75 (diff) | |
parent | cbd8a54f8c55e1982430fc929e9d74f977699428 (diff) | |
download | Qt-e67cd6560eea4e4b600d5e3586cd823347e101d2.zip Qt-e67cd6560eea4e4b600d5e3586cd823347e101d2.tar.gz Qt-e67cd6560eea4e4b600d5e3586cd823347e101d2.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Conflicts:
src/gui/kernel/qapplication_win.cpp
Diffstat (limited to 'src/testlib/qbenchmark.h')
-rw-r--r-- | src/testlib/qbenchmark.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/testlib/qbenchmark.h b/src/testlib/qbenchmark.h index c06bfc0..87d34e7 100644 --- a/src/testlib/qbenchmark.h +++ b/src/testlib/qbenchmark.h @@ -64,7 +64,8 @@ namespace QTest class Q_TESTLIB_EXPORT QBenchmarkIterationController { public: - QBenchmarkIterationController(); + enum RunMode { RepeatUntilValidMeasurement, RunOnce }; + QBenchmarkIterationController(RunMode runMode); ~QBenchmarkIterationController(); bool isDone(); void next(); @@ -74,7 +75,12 @@ public: } #define QBENCHMARK \ - for (QTest::QBenchmarkIterationController __iteration_controller; __iteration_controller.isDone() == false; __iteration_controller.next()) + for (QTest::QBenchmarkIterationController __iteration_controller(QTest::QBenchmarkIterationController::RepeatUntilValidMeasurement); \ + __iteration_controller.isDone() == false; __iteration_controller.next()) + +#define QBENCHMARK_ONCE \ + for (QTest::QBenchmarkIterationController __iteration_controller(QTest::QBenchmarkIterationController::RunOnce); \ + __iteration_controller.isDone() == false; __iteration_controller.next()) QT_END_NAMESPACE |