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

Unified Diff: chrome/browser/mac/mac_startup_profiler.cc

Issue 1425263003: Use TimeTicks as much as possible in startup_metric_utils. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix mac compile Created 5 years, 1 month 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 | « chrome/browser/mac/mac_startup_profiler.h ('k') | chrome/browser/metrics/first_web_contents_profiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/mac/mac_startup_profiler.cc
diff --git a/chrome/browser/mac/mac_startup_profiler.cc b/chrome/browser/mac/mac_startup_profiler.cc
index 95aa7d8da005bf710baa1282b5c995a3bc0d6ba7..628d11627657abc922a45186641850a72c3beb0c 100644
--- a/chrome/browser/mac/mac_startup_profiler.cc
+++ b/chrome/browser/mac/mac_startup_profiler.cc
@@ -20,22 +20,22 @@ MacStartupProfiler::~MacStartupProfiler() {
}
void MacStartupProfiler::Profile(Location location) {
- profiled_times_[location] = base::Time::Now();
+ profiled_ticks_[location] = base::TimeTicks::Now();
}
void MacStartupProfiler::RecordMetrics() {
- const base::Time main_entry_time = startup_metric_utils::MainEntryPointTime();
- DCHECK(!main_entry_time.is_null());
+ const base::TimeTicks main_entry_ticks =
+ startup_metric_utils::MainEntryPointTicks();
+ DCHECK(!main_entry_ticks.is_null());
DCHECK(!recorded_metrics_);
recorded_metrics_ = true;
- for (std::map<Location, base::Time>::const_iterator it =
- profiled_times_.begin();
- it != profiled_times_.end();
- ++it) {
- const base::Time& location_time = it->second;
- base::TimeDelta delta = location_time - main_entry_time;
+ for (std::map<Location, base::TimeTicks>::const_iterator it =
+ profiled_ticks_.begin();
+ it != profiled_ticks_.end(); ++it) {
Nico 2015/11/10 05:15:50 nit: since you're touching this anyways, consider
gab 2015/11/10 14:52:41 Done.
+ const base::TimeTicks& location_ticks = it->second;
+ base::TimeDelta delta = location_ticks - main_entry_ticks;
RecordHistogram(it->first, delta);
}
}
« no previous file with comments | « chrome/browser/mac/mac_startup_profiler.h ('k') | chrome/browser/metrics/first_web_contents_profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698