diff options
author | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-10 16:35:47 +0000 |
---|---|---|
committer | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-10 16:35:47 +0000 |
commit | 85632fab9c8f30b4651f06fd75e1ba5881226e6c (patch) | |
tree | 45e5c31224f7b5951fbefb387da4f3fbf7acbd85 /base/tracked.cc | |
parent | 99aae10b7b9cd4c1e08bb4e978c822483864e331 (diff) | |
download | chromium_src-85632fab9c8f30b4651f06fd75e1ba5881226e6c.zip chromium_src-85632fab9c8f30b4651f06fd75e1ba5881226e6c.tar.gz chromium_src-85632fab9c8f30b4651f06fd75e1ba5881226e6c.tar.bz2 |
Switch to using TimeTicks for profiling and histograms
Avoid using wall clock time, which can be changed by the user,
or impacted by Daylight Savings transitions etc.
BUG=14193
r=eroman
Review URL: http://codereview.chromium.org/1253005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46821 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/tracked.cc')
-rw-r--r-- | base/tracked.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/base/tracked.cc b/base/tracked.cc index 34694bb..fdac6d3 100644 --- a/base/tracked.cc +++ b/base/tracked.cc @@ -7,7 +7,7 @@ #include "base/string_util.h" #include "base/tracked_objects.h" -using base::Time; +using base::TimeTicks; namespace tracked_objects { @@ -56,7 +56,9 @@ void Tracked::ResetBirthTime() {} #else -Tracked::Tracked() : tracked_births_(NULL), tracked_birth_time_(Time::Now()) { +Tracked::Tracked() + : tracked_births_(NULL), + tracked_birth_time_(TimeTicks::Now()) { if (!ThreadData::IsActive()) return; SetBirthPlace(Location("NoFunctionName", "NeedToSetBirthPlace", -1)); @@ -66,7 +68,7 @@ Tracked::~Tracked() { if (!ThreadData::IsActive() || !tracked_births_) return; ThreadData::current()->TallyADeath(*tracked_births_, - Time::Now() - tracked_birth_time_); + TimeTicks::Now() - tracked_birth_time_); } void Tracked::SetBirthPlace(const Location& from_here) { @@ -81,7 +83,7 @@ void Tracked::SetBirthPlace(const Location& from_here) { } void Tracked::ResetBirthTime() { - tracked_birth_time_ = Time::Now(); + tracked_birth_time_ = TimeTicks::Now(); } bool Tracked::MissingBirthplace() const { |