diff options
Diffstat (limited to 'src/testlib/qbenchmark.h')
-rw-r--r-- | src/testlib/qbenchmark.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/testlib/qbenchmark.h b/src/testlib/qbenchmark.h index c06bfc0..4c23695 100644 --- a/src/testlib/qbenchmark.h +++ b/src/testlib/qbenchmark.h @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. +** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ @@ -64,7 +64,9 @@ namespace QTest class Q_TESTLIB_EXPORT QBenchmarkIterationController { public: + enum RunMode { RepeatUntilValidMeasurement, RunOnce }; QBenchmarkIterationController(); + QBenchmarkIterationController(RunMode runMode); ~QBenchmarkIterationController(); bool isDone(); void next(); @@ -74,7 +76,12 @@ public: } #define QBENCHMARK \ - for (QTest::QBenchmarkIterationController __iteration_controller; __iteration_controller.isDone() == false; __iteration_controller.next()) + for (QTest::QBenchmarkIterationController __iteration_controller; \ + __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 |