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

Unified Diff: bench/BenchTimer.h

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 | « no previous file | bench/BenchTimer.cpp » ('j') | tools/bench_playback.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/BenchTimer.h
diff --git a/bench/BenchTimer.h b/bench/BenchTimer.h
index 09950a734be956934c96de59c233186a3c4293ca..2abf10b80f9e1d4cca7234cbbd2782af8a37c980 100644
--- a/bench/BenchTimer.h
+++ b/bench/BenchTimer.h
@@ -39,12 +39,29 @@ public:
double fGpu;
private:
- BenchSysTimer *fSysTimer;
- BenchSysTimer *fTruncatedSysTimer;
+ BenchSysTimer* fSysTimer;
+ BenchSysTimer* fTruncatedSysTimer;
#if SK_SUPPORT_GPU
- BenchGpuTimer *fGpuTimer;
+ BenchGpuTimer* fGpuTimer;
#endif
double fDurationScale; // for this start/end session
};
+// Same as BenchTimer above, supporting only fWall but with much lower overhead.
+// (Typically, ~30ns instead of BenchTimer's ~1us.)
+class WallTimer {
+public:
+ WallTimer();
+ ~WallTimer();
+
+ void start(double durationScale = 1);
+ void end();
+
+ double fWall;
+
+private:
+ BenchSysTimer* fSysTimer;
+ double fDurationScale;
+};
+
#endif
« no previous file with comments | « no previous file | bench/BenchTimer.cpp » ('j') | tools/bench_playback.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698