Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(492)

Side by Side Diff: bench/TimerData.cpp

Issue 117393002: Fix handling of aggregate times in TimerData::getResult (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 double truncCpuMin = std::numeric_limits<double>::max(); 65 double truncCpuMin = std::numeric_limits<double>::max();
66 double gpuMin = std::numeric_limits<double>::max(); 66 double gpuMin = std::numeric_limits<double>::max();
67 67
68 double wallSum = 0; 68 double wallSum = 0;
69 double truncWallSum = 0; 69 double truncWallSum = 0;
70 double cpuSum = 0; 70 double cpuSum = 0;
71 double truncCpuSum = 0; 71 double truncCpuSum = 0;
72 double gpuSum = 0; 72 double gpuSum = 0;
73 73
74 for (int i = 0; i < numTimings; ++i) { 74 for (int i = 0; i < numTimings; ++i) {
75 if (kPerIter_Result == result) { 75 if (kPerIter_Result == result) {
robertphillips 2013/12/17 16:20:54 This is modeled on what is done for kMin_Result be
76 wallStr.appendf(doubleFormat, fWallTimes[i]); 76 wallStr.appendf(doubleFormat, fWallTimes[i] / itersPerTiming);
77 truncWallStr.appendf(doubleFormat, fTruncatedWallTimes[i]); 77 truncWallStr.appendf(doubleFormat, fTruncatedWallTimes[i] / itersPer Timing);
78 cpuStr.appendf(doubleFormat, fCpuTimes[i]); 78 cpuStr.appendf(doubleFormat, fCpuTimes[i] / itersPerTiming);
79 truncCpuStr.appendf(doubleFormat, fTruncatedCpuTimes[i]); 79 truncCpuStr.appendf(doubleFormat, fTruncatedCpuTimes[i] / itersPerTi ming);
80 gpuStr.appendf(doubleFormat, fGpuTimes[i]); 80 gpuStr.appendf(doubleFormat, fGpuTimes[i] / itersPerTiming);
81 81
82 if (i != numTimings - 1) { 82 if (i != numTimings - 1) {
83 static const char kSep[] = ", "; 83 static const char kSep[] = ", ";
84 wallStr.append(kSep); 84 wallStr.append(kSep);
85 truncWallStr.append(kSep); 85 truncWallStr.append(kSep);
86 cpuStr.append(kSep); 86 cpuStr.append(kSep);
87 truncCpuStr.append(kSep); 87 truncCpuStr.append(kSep);
88 gpuStr.append(kSep); 88 gpuStr.append(kSep);
89 } 89 }
90 } else if (kMin_Result == result) { 90 } else if (kMin_Result == result) {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 str += cpuStr; 133 str += cpuStr;
134 } 134 }
135 if (timerFlags & kTruncatedCpu_Flag) { 135 if (timerFlags & kTruncatedCpu_Flag) {
136 str += truncCpuStr; 136 str += truncCpuStr;
137 } 137 }
138 if ((timerFlags & kGpu_Flag) && gpuSum > 0) { 138 if ((timerFlags & kGpu_Flag) && gpuSum > 0) {
139 str += gpuStr; 139 str += gpuStr;
140 } 140 }
141 return str; 141 return str;
142 } 142 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698