summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2010-11-05 03:27:30 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2010-11-19 00:56:45 (GMT)
commit7aebf28291288ea6e8c1d9d28f4ed752b00dca97 (patch)
tree26584dd314ac01df1ead5538919fe0db0cf962cb /tests
parent3c05109ce609574f1525c465f68817d3af39397e (diff)
downloadQt-7aebf28291288ea6e8c1d9d28f4ed752b00dca97.zip
Qt-7aebf28291288ea6e8c1d9d28f4ed752b00dca97.tar.gz
Qt-7aebf28291288ea6e8c1d9d28f4ed752b00dca97.tar.bz2
Make deferred tracing less expensive (real-time cost is the same)
Diffstat (limited to 'tests')
-rw-r--r--tests/benchmarks/declarative/qperformancetimer/tst_qperformancetimer.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/benchmarks/declarative/qperformancetimer/tst_qperformancetimer.cpp b/tests/benchmarks/declarative/qperformancetimer/tst_qperformancetimer.cpp
index 04737e7..497a556 100644
--- a/tests/benchmarks/declarative/qperformancetimer/tst_qperformancetimer.cpp
+++ b/tests/benchmarks/declarative/qperformancetimer/tst_qperformancetimer.cpp
@@ -54,6 +54,7 @@ private slots:
void all();
void startElapsed();
void doubleElapsed();
+ void trace();
};
void tst_qperformancetimer::all()
@@ -84,6 +85,16 @@ void tst_qperformancetimer::doubleElapsed()
}
}
+void tst_qperformancetimer::trace()
+{
+ QString s("A decent sized string of text here.");
+ QBENCHMARK {
+ QByteArray data;
+ QDataStream ds(&data, QIODevice::WriteOnly);
+ ds << (qint64)100 << (int)5 << (int)5 << s;
+ }
+}
+
QTEST_MAIN(tst_qperformancetimer)
#include "tst_qperformancetimer.moc"