From 2b86b3074ca3473e309bfe4a6975f96020322f08 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Thu, 3 Dec 2009 10:26:52 +1000 Subject: Separate out first time construction cost --- tests/benchmarks/declarative/qmltime/qmltime.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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; } -- cgit v0.12