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

Unified Diff: base/process/process_metrics_freebsd.cc

Issue 139103007: Use TimeTicks instead of gettimeofday in ProcessMetrics. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 11 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
Index: base/process/process_metrics_freebsd.cc
diff --git a/base/process/process_metrics_freebsd.cc b/base/process/process_metrics_freebsd.cc
index fbb8a889457e593dc56e53005815a0da479c92d7..d0525f94b71f65d4bbbd6790d94242b237cefb89 100644
--- a/base/process/process_metrics_freebsd.cc
+++ b/base/process/process_metrics_freebsd.cc
@@ -8,7 +8,6 @@ namespace base {
ProcessMetrics::ProcessMetrics(ProcessHandle process)
: process_(process),
- last_cpu_time_(0),
last_system_time_(0),
last_cpu_(0) {
processor_count_ = base::SysInfo::NumberOfProcessors();
@@ -81,11 +80,6 @@ double ProcessMetrics::GetCPUUsage() {
int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process_ };
size_t length = sizeof(info);
- struct timeval now;
- int retval = gettimeofday(&now, NULL);
- if (retval)
- return 0;
-
if (sysctl(mib, arraysize(mib), &info, &length, NULL, 0) < 0)
return 0;

Powered by Google App Engine
This is Rietveld 408576698