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

Unified Diff: base/process/process_metrics_linux.cc

Issue 1160533002: Change outputting ints in win/linux GetCpuUsage to doubles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « no previous file | base/process/process_metrics_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/process_metrics_linux.cc
diff --git a/base/process/process_metrics_linux.cc b/base/process/process_metrics_linux.cc
index 2d54c4c72657da6b2c54674c7fec9cb3a5577725..c564a6798baa6623a3646c35822b5041e1e5ad47 100644
--- a/base/process/process_metrics_linux.cc
+++ b/base/process/process_metrics_linux.cc
@@ -228,7 +228,7 @@ double ProcessMetrics::GetCPUUsage() {
// are together adding to more than one CPU's worth.
TimeDelta cpu_time = internal::ClockTicksToTimeDelta(cpu);
TimeDelta last_cpu_time = internal::ClockTicksToTimeDelta(last_cpu_);
- int percentage = 100 * (cpu_time - last_cpu_time).InSecondsF() /
+ double percentage = 100.0 * (cpu_time - last_cpu_time).InSecondsF() /
TimeDelta::FromMicroseconds(time_delta).InSecondsF();
last_cpu_time_ = time;
« no previous file with comments | « no previous file | base/process/process_metrics_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698