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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bench/BenchTimer.h ('k') | tools/Stats.h » ('j') | tools/bench_playback.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/BenchTimer.cpp
diff --git a/bench/BenchTimer.cpp b/bench/BenchTimer.cpp
index 3617f9de58b243253499f65df6bf340153a6d8da..f3e8e3b0ec69483f3d298bf3772eb668cd421988 100644
--- a/bench/BenchTimer.cpp
+++ b/bench/BenchTimer.cpp
@@ -76,3 +76,19 @@ void BenchTimer::truncatedEnd() {
fTruncatedCpu = fTruncatedSysTimer->endCpu() * fDurationScale;
fTruncatedWall = fTruncatedSysTimer->endWall() * fDurationScale;
}
+
+WallTimer::WallTimer() : fWall(-1.0), fSysTimer(new BenchSysTimer) {}
+
+WallTimer::~WallTimer() {
+ delete fSysTimer;
+}
+
+void WallTimer::start(double durationScale) {
+ fDurationScale = durationScale;
+ fSysTimer->startWall();
+}
+
+void WallTimer::end() {
+ fWall = fSysTimer->endWall() * fDurationScale;
+}
+
« 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