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

Unified Diff: cc/debug/lap_timer.cc

Issue 1122153002: Fixit: Fork base::TimeTicks --> TimeTicks + ThreadTicks + TraceTicks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@FIXIT_timeclasses_1of2
Patch Set: REBASE after it passed CQ but did not commit to tree Created 5 years, 7 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 | « cc/debug/lap_timer.h ('k') | cc/debug/rendering_stats_instrumentation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/debug/lap_timer.cc
diff --git a/cc/debug/lap_timer.cc b/cc/debug/lap_timer.cc
index 17bca3d313f11869563d90728bbb46741b345d9e..eb6900c460a7403c7abdaaf882c8a3b25ba89e3a 100644
--- a/cc/debug/lap_timer.cc
+++ b/cc/debug/lap_timer.cc
@@ -10,9 +10,13 @@ namespace cc {
namespace {
-base::TimeTicks Now() {
- return base::TimeTicks::IsThreadNowSupported() ? base::TimeTicks::ThreadNow()
- : base::TimeTicks::Now();
+// Returns the offset from the origin from the ThreadTicks time source.
+// TimeTicks is used as a fallback if ThreadTicks is not available on the
+// current platform.
+base::TimeDelta Now() {
+ return base::ThreadTicks::IsSupported()
+ ? base::ThreadTicks::Now() - base::ThreadTicks()
+ : base::TimeTicks::Now() - base::TimeTicks();
}
// Default values.
@@ -65,7 +69,7 @@ void LapTimer::NextLap() {
++num_laps_;
--remaining_no_check_laps_;
if (!remaining_no_check_laps_) {
- base::TimeTicks now = Now();
+ base::TimeDelta now = Now();
accumulator_ += now - start_time_;
start_time_ = now;
remaining_no_check_laps_ = check_interval_;
« no previous file with comments | « cc/debug/lap_timer.h ('k') | cc/debug/rendering_stats_instrumentation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698