blob: d97a0632aadf2eaff86e76123d22e2719174518c [file] [log] [blame]
scroggo@google.com9a412522012-09-07 15:21:18 +00001
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
14class BenchTimer;
15
16class TimerData {
17public:
bsalomon@google.com68f2a0d2013-07-25 21:30:52 +000018 TimerData(const SkString& perIterTimeFormat, const SkString& normalTimeFormat);
scroggo@google.com9a412522012-09-07 15:21:18 +000019
20 /**
bsalomon@google.com68f2a0d2013-07-25 21:30:52 +000021 * Append the value from each timer in BenchTimer to our various strings, and update the
22 * minimum and sum times.
scroggo@google.com9a412522012-09-07 15:21:18 +000023 * @param BenchTimer Must not be null.
bsalomon@google.com68f2a0d2013-07-25 21:30:52 +000024 * @param last True if this is the last set of times to add.
scroggo@google.com9a412522012-09-07 15:21:18 +000025 */
bsalomon@google.com68f2a0d2013-07-25 21:30:52 +000026 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);
commit-bot@chromium.org47fad702013-07-25 20:01:20 +000030private:
bsalomon@google.com68f2a0d2013-07-25 21:30:52 +000031 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;
commit-bot@chromium.org47fad702013-07-25 20:01:20 +000041
bsalomon@google.com68f2a0d2013-07-25 21:30:52 +000042 SkString fPerIterTimeFormat;
43 SkString fNormalTimeFormat;
scroggo@google.com9a412522012-09-07 15:21:18 +000044};
45
46#endif // TimerData_DEFINED