Home | History | Annotate | Download | only in bench
      1 
      2 /*
      3  * Copyright 2012 Google Inc.
      4  *
      5  * Use of this source code is governed by a BSD-style license that can be
      6  * found in the LICENSE file.
      7  */
      8 
      9 #ifndef TimerData_DEFINED
     10 #define TimerData_DEFINED
     11 
     12 #include "SkString.h"
     13 
     14 class BenchTimer;
     15 
     16 class TimerData {
     17 public:
     18     TimerData(const SkString& perIterTimeFormat, const SkString& normalTimeFormat);
     19 
     20     /**
     21      * Append the value from each timer in BenchTimer to our various strings, and update the
     22      * minimum and sum times.
     23      * @param BenchTimer Must not be null.
     24      * @param last True if this is the last set of times to add.
     25      */
     26     void appendTimes(BenchTimer*, bool last);
     27     SkString getResult(bool logPerIter, bool printMin, int repeatDraw, const char* configName,
     28                        bool showWallTime, bool showTruncatedWallTime, bool showCpuTime,
     29                        bool showTruncatedCpuTime, bool showGpuTime);
     30 private:
     31     SkString fWallStr;
     32     SkString fTruncatedWallStr;
     33     SkString fCpuStr;
     34     SkString fTruncatedCpuStr;
     35     SkString fGpuStr;
     36     double fWallSum, fWallMin;
     37     double fTruncatedWallSum, fTruncatedWallMin;
     38     double fCpuSum, fCpuMin;
     39     double fTruncatedCpuSum, fTruncatedCpuMin;
     40     double fGpuSum, fGpuMin;
     41 
     42     SkString fPerIterTimeFormat;
     43     SkString fNormalTimeFormat;
     44 };
     45 
     46 #endif // TimerData_DEFINED
     47