Add benchmark for QString::number(int)
Add a almost trivial benchmark for QString::number(int). Change-Id: Ice67eaf28e8d7b235fd5ec5e0b87b3b9053ae61e Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
parent
cca62a7360
commit
2516fc935c
@ -37,6 +37,7 @@ private Q_SLOTS:
|
||||
void toUpper_QLocale_1();
|
||||
void toUpper_QLocale_2();
|
||||
void toUpper_QString();
|
||||
void number_QString();
|
||||
};
|
||||
|
||||
static QString data()
|
||||
@ -66,6 +67,14 @@ void tst_QLocale::toUpper_QString()
|
||||
QBENCHMARK { LOOP(QString t(s.toUpper())) }
|
||||
}
|
||||
|
||||
void tst_QLocale::number_QString()
|
||||
{
|
||||
QString s;
|
||||
QBENCHMARK {
|
||||
s = QString::number(12345678);
|
||||
}
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_QLocale)
|
||||
|
||||
#include "main.moc"
|
||||
|
Loading…
Reference in New Issue
Block a user