OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "TimerData.h" | 9 #include "TimerData.h" |
10 | 10 |
11 #include "BenchTimer.h" | 11 #include "BenchTimer.h" |
12 #include <limits> | 12 #include <limits> |
13 | 13 |
14 using namespace std; | 14 using namespace std; |
15 | 15 |
16 TimerData::TimerData(const SkString& perIterTimeFormat, const SkString& normalTi
meFormat) | 16 TimerData::TimerData(const SkString& perIterTimeFormat, const SkString& normalTi
meFormat) |
17 : fWallStr(" msecs = ") | 17 : fWallStr(" msecs = ") |
18 , fTruncatedWallStr(" Wmsecs = ") | 18 , fTruncatedWallStr(" Wmsecs = ") |
19 , fCpuStr(" cmsecs = ") | 19 , fCpuStr(" cmsecs = ") |
20 , fTruncatedCpuStr(" Cmsecs = ") | 20 , fTruncatedCpuStr(" Cmsecs = ") |
21 , fGpuStr(" gmsecs = ") | 21 , fGpuStr(" gmsecs = ") |
22 , fWallSum(0.0) | 22 , fWallSum(0.0) |
23 , fWallMin((numeric_limits<double>::max)()) // Extra parens to make the windows
build work, due to | 23 , fWallMin(numeric_limits<double>::max()) |
24 // 'max' macro | |
25 , fTruncatedWallSum(0.0) | 24 , fTruncatedWallSum(0.0) |
26 , fTruncatedWallMin((numeric_limits<double>::max)()) | 25 , fTruncatedWallMin(numeric_limits<double>::max()) |
27 , fCpuSum(0.0) | 26 , fCpuSum(0.0) |
28 , fCpuMin((numeric_limits<double>::max)()) | 27 , fCpuMin(numeric_limits<double>::max()) |
29 , fTruncatedCpuSum(0.0) | 28 , fTruncatedCpuSum(0.0) |
30 , fTruncatedCpuMin((numeric_limits<double>::max)()) | 29 , fTruncatedCpuMin(numeric_limits<double>::max()) |
31 , fGpuSum(0.0) | 30 , fGpuSum(0.0) |
32 , fGpuMin((numeric_limits<double>::max)()) | 31 , fGpuMin(numeric_limits<double>::max()) |
33 , fPerIterTimeFormat(perIterTimeFormat) | 32 , fPerIterTimeFormat(perIterTimeFormat) |
34 , fNormalTimeFormat(normalTimeFormat) | 33 , fNormalTimeFormat(normalTimeFormat) |
35 {} | 34 {} |
36 | 35 |
37 static double Min(double a, double b) { | 36 static double Min(double a, double b) { |
38 return (a < b) ? a : b; | 37 return (a < b) ? a : b; |
39 } | 38 } |
40 | 39 |
41 void TimerData::appendTimes(BenchTimer* timer, bool last) { | 40 void TimerData::appendTimes(BenchTimer* timer, bool last) { |
42 SkASSERT(timer != NULL); | 41 SkASSERT(timer != NULL); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 str += fCpuStr; | 99 str += fCpuStr; |
101 } | 100 } |
102 if (showTruncatedCpuTime) { | 101 if (showTruncatedCpuTime) { |
103 str += fTruncatedCpuStr; | 102 str += fTruncatedCpuStr; |
104 } | 103 } |
105 if (showGpuTime && fGpuSum > 0) { | 104 if (showGpuTime && fGpuSum > 0) { |
106 str += fGpuStr; | 105 str += fGpuStr; |
107 } | 106 } |
108 return str; | 107 return str; |
109 } | 108 } |
OLD | NEW |