summaryrefslogtreecommitdiffstats
path: root/base/profiler
diff options
context:
space:
mode:
Diffstat (limited to 'base/profiler')
-rw-r--r--base/profiler/scoped_profile.cc4
-rw-r--r--base/profiler/tracked_time_unittest.cc4
2 files changed, 6 insertions, 2 deletions
diff --git a/base/profiler/scoped_profile.cc b/base/profiler/scoped_profile.cc
index 7bd31fe..71e25dc 100644
--- a/base/profiler/scoped_profile.cc
+++ b/base/profiler/scoped_profile.cc
@@ -13,7 +13,7 @@ namespace tracked_objects {
ScopedProfile::ScopedProfile(const Location& location)
: birth_(ThreadData::TallyABirthIfActive(location)),
- start_of_run_(ThreadData::Now()) {
+ start_of_run_(ThreadData::NowForStartOfRun()) {
}
ScopedProfile::~ScopedProfile() {
@@ -24,7 +24,7 @@ void ScopedProfile::StopClockAndTally() {
if (!birth_)
return;
ThreadData::TallyRunInAScopedRegionIfTracking(birth_, start_of_run_,
- ThreadData::Now());
+ ThreadData::NowForEndOfRun());
birth_ = NULL;
}
diff --git a/base/profiler/tracked_time_unittest.cc b/base/profiler/tracked_time_unittest.cc
index fee4ba6..7474375 100644
--- a/base/profiler/tracked_time_unittest.cc
+++ b/base/profiler/tracked_time_unittest.cc
@@ -81,6 +81,10 @@ TEST(TrackedTimeTest, TrackedTimerDisabled) {
// Since we disabled tracking, we should get a null response.
TrackedTime track_now = ThreadData::Now();
EXPECT_TRUE(track_now.is_null());
+ track_now = ThreadData::NowForStartOfRun();
+ EXPECT_TRUE(track_now.is_null());
+ track_now = ThreadData::NowForEndOfRun();
+ EXPECT_TRUE(track_now.is_null());
}
TEST(TrackedTimeTest, TrackedTimerEnabled) {