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

Side by Side Diff: bench/BenchTimer.cpp

Issue 338203002: Refine bench_record and bench_playback: (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 months 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
OLDNEW
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
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
OLDNEW
« no previous file with comments | « bench/BenchTimer.h ('k') | tools/Stats.h » ('j') | tools/bench_playback.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698