diff options
author | dsinclair@chromium.org <dsinclair@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-06 05:51:43 +0000 |
---|---|---|
committer | dsinclair@chromium.org <dsinclair@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-06 05:51:43 +0000 |
commit | b9c206c984eb6e03ae4580d53efacd98749d0852 (patch) | |
tree | 023c67d3dadada553190eea816484f968ec96904 /cc/debug | |
parent | 852511c5339a5f12a406c60ec201f1159ad8959e (diff) | |
download | chromium_src-b9c206c984eb6e03ae4580d53efacd98749d0852.zip chromium_src-b9c206c984eb6e03ae4580d53efacd98749d0852.tar.gz chromium_src-b9c206c984eb6e03ae4580d53efacd98749d0852.tar.bz2 |
Use ThreadNow() for recording times.
If available, this CL changes RenderingStatsInstrumentation to use
ThreadNow() instead of HighResNow(). ThreadNow should provide a more accurate
benchmark as it will exclude time when the thread is descheduled.
BUG=280638
Review URL: https://chromiumcodereview.appspot.com/23523026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221591 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/debug')
-rw-r--r-- | cc/debug/rendering_stats_instrumentation.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/cc/debug/rendering_stats_instrumentation.cc b/cc/debug/rendering_stats_instrumentation.cc index 2c5b252..3c2c96b 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(); } |