OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 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 #include "BenchTimer.h" | 8 #include "BenchTimer.h" |
9 #if defined(SK_BUILD_FOR_WIN32) | 9 #if defined(SK_BUILD_FOR_WIN32) |
10 #include "BenchSysTimer_windows.h" | 10 #include "BenchSysTimer_windows.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 fGpu = fGpuTimer->endGpu() * fDurationScale; | 69 fGpu = fGpuTimer->endGpu() * fDurationScale; |
70 } | 70 } |
71 #endif | 71 #endif |
72 fWall = fSysTimer->endWall() * fDurationScale; | 72 fWall = fSysTimer->endWall() * fDurationScale; |
73 } | 73 } |
74 | 74 |
75 void BenchTimer::truncatedEnd() { | 75 void BenchTimer::truncatedEnd() { |
76 fTruncatedCpu = fTruncatedSysTimer->endCpu() * fDurationScale; | 76 fTruncatedCpu = fTruncatedSysTimer->endCpu() * fDurationScale; |
77 fTruncatedWall = fTruncatedSysTimer->endWall() * fDurationScale; | 77 fTruncatedWall = fTruncatedSysTimer->endWall() * fDurationScale; |
78 } | 78 } |
| 79 |
| 80 WallTimer::WallTimer() : fWall(-1.0), fSysTimer(new BenchSysTimer) {} |
| 81 |
| 82 WallTimer::~WallTimer() { |
| 83 delete fSysTimer; |
| 84 } |
| 85 |
| 86 void WallTimer::start(double durationScale) { |
| 87 fDurationScale = durationScale; |
| 88 fSysTimer->startWall(); |
| 89 } |
| 90 |
| 91 void WallTimer::end() { |
| 92 fWall = fSysTimer->endWall() * fDurationScale; |
| 93 } |
| 94 |
OLD | NEW |