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

Unified Diff: cc/debug/rendering_stats_instrumentation.cc

Issue 23523026: Use ThreadNow() for recording times. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/debug/rendering_stats_instrumentation.cc
diff --git a/cc/debug/rendering_stats_instrumentation.cc b/cc/debug/rendering_stats_instrumentation.cc
index 2c5b2523b1009f933d32a181979bd0d7e9651f5a..3c2c96b8b00b42f1722750ee77110a64d5423de5 100644
--- a/cc/debug/rendering_stats_instrumentation.cc
+++ b/cc/debug/rendering_stats_instrumentation.cc
@@ -39,15 +39,21 @@ void RenderingStatsInstrumentation::AccumulateAndClearImplThreadStats() {
}
base::TimeTicks RenderingStatsInstrumentation::StartRecording() const {
- if (record_rendering_stats_)
+ if (record_rendering_stats_) {
+ if (base::TimeTicks::IsThreadNowSupported())
+ return base::TimeTicks::ThreadNow();
return base::TimeTicks::HighResNow();
+ }
return base::TimeTicks();
}
base::TimeDelta RenderingStatsInstrumentation::EndRecording(
base::TimeTicks start_time) const {
- if (!start_time.is_null())
+ if (!start_time.is_null()) {
+ if (base::TimeTicks::IsThreadNowSupported())
+ return base::TimeTicks::ThreadNow() - start_time;
return base::TimeTicks::HighResNow() - start_time;
+ }
return base::TimeDelta();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698