src/testlib/qbenchmarkmeasurement.cpp
branchGCC_SURGE
changeset 31 5daf16870df6
parent 30 5dc02b23752f
child 33 3e2da88830cd
equal deleted inserted replaced
27:93b982ccede2 31:5daf16870df6
    39 **
    39 **
    40 ****************************************************************************/
    40 ****************************************************************************/
    41 
    41 
    42 #include "QtTest/private/qbenchmarkmeasurement_p.h"
    42 #include "QtTest/private/qbenchmarkmeasurement_p.h"
    43 #include "QtTest/private/qbenchmark_p.h"
    43 #include "QtTest/private/qbenchmark_p.h"
       
    44 #include "QtTest/private/qbenchmarkmetric_p.h"
       
    45 #include "qbenchmark.h"
    44 #include <qdebug.h>
    46 #include <qdebug.h>
    45 
    47 
    46 QT_BEGIN_NAMESPACE
    48 QT_BEGIN_NAMESPACE
    47 
    49 
    48 // QBenchmarkTimeMeasurer implementation
    50 // QBenchmarkTimeMeasurer implementation
    75 int QBenchmarkTimeMeasurer::adjustMedianCount(int)
    77 int QBenchmarkTimeMeasurer::adjustMedianCount(int)
    76 { 
    78 { 
    77     return 1; 
    79     return 1; 
    78 }
    80 }
    79 
    81 
    80 QString QBenchmarkTimeMeasurer::unitText()
    82 QTest::QBenchmarkMetric QBenchmarkTimeMeasurer::metricType()
    81 {
    83 {
    82     return QLatin1String("msec");
    84     return QTest::WalltimeMilliseconds;
    83 }
       
    84 
       
    85 QString QBenchmarkTimeMeasurer::metricText()
       
    86 {
       
    87     return QLatin1String("walltime");
       
    88 }
    85 }
    89 
    86 
    90 #ifdef HAVE_TICK_COUNTER // defined in 3rdparty/cycle_p.h
    87 #ifdef HAVE_TICK_COUNTER // defined in 3rdparty/cycle_p.h
    91 
    88 
    92 void QBenchmarkTickMeasurer::start()
    89 void QBenchmarkTickMeasurer::start()
   124 bool QBenchmarkTickMeasurer::needsWarmupIteration()
   121 bool QBenchmarkTickMeasurer::needsWarmupIteration()
   125 { 
   122 { 
   126     return true; 
   123     return true; 
   127 }
   124 }
   128 
   125 
   129 QString QBenchmarkTickMeasurer::unitText()
   126 QTest::QBenchmarkMetric QBenchmarkTickMeasurer::metricType()
   130 {
   127 {
   131     return QLatin1String("ticks");
   128     return QTest::CPUTicks;
   132 }
       
   133 
       
   134 QString QBenchmarkTickMeasurer::metricText()
       
   135 {
       
   136     return QLatin1String("cputicks");
       
   137 }
   129 }
   138 
   130 
   139 #endif
   131 #endif
   140 
   132 
   141 
   133