diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-12-03 00:26:52 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-12-03 00:26:52 (GMT) |
commit | 2b86b3074ca3473e309bfe4a6975f96020322f08 (patch) | |
tree | 22d8cc0ff3518ecf1875b09c818b0d35b6bea54c | |
parent | 5247ee562f76a51b8a81735d7da709d1b9b63796 (diff) | |
download | Qt-2b86b3074ca3473e309bfe4a6975f96020322f08.zip Qt-2b86b3074ca3473e309bfe4a6975f96020322f08.tar.gz Qt-2b86b3074ca3473e309bfe4a6975f96020322f08.tar.bz2 |
Separate out first time construction cost
-rw-r--r-- | tests/benchmarks/declarative/qmltime/qmltime.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/benchmarks/declarative/qmltime/qmltime.cpp b/tests/benchmarks/declarative/qmltime/qmltime.cpp index 27019f4..f065444 100644 --- a/tests/benchmarks/declarative/qmltime/qmltime.cpp +++ b/tests/benchmarks/declarative/qmltime/qmltime.cpp @@ -21,6 +21,8 @@ public: void run(uint); private: + void runTest(QmlContext *, uint); + QmlComponent *m_component; static Timer *m_timer; }; @@ -56,10 +58,19 @@ void Timer::run(uint iterations) { QmlContext context(qmlContext(this)); + QObject *o = m_component->create(&context); + delete o; + + + runTest(&context, iterations); +} + +void Timer::runTest(QmlContext *context, uint iterations) +{ QTime t; t.start(); for (uint ii = 0; ii < iterations; ++ii) { - QObject *o = m_component->create(&context); + QObject *o = m_component->create(context); delete o; } |