Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/process/process_metrics.h" | 5 #include "base/process/process_metrics.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 79 if (time_delta == 0) { | 79 if (time_delta == 0) { |
| 80 NOTREACHED(); | 80 NOTREACHED(); |
| 81 return 0; | 81 return 0; |
| 82 } | 82 } |
| 83 | 83 |
| 84 last_idle_wakeups_time_ = time; | 84 last_idle_wakeups_time_ = time; |
| 85 last_absolute_idle_wakeups_ = absolute_idle_wakeups; | 85 last_absolute_idle_wakeups_ = absolute_idle_wakeups; |
| 86 | 86 |
| 87 // Round to average wakeups per second. | 87 // Round to average wakeups per second. |
| 88 int64_t wakeups_delta_for_ms = wakeups_delta * Time::kMicrosecondsPerSecond; | 88 int64_t wakeups_delta_for_ms = wakeups_delta * Time::kMicrosecondsPerSecond; |
| 89 return (wakeups_delta_for_ms + time_delta / 2) / time_delta; | 89 return wakeups_delta_for_ms / time_delta; |
|
brucedawson
2017/02/02 00:55:29
This term is presumably (see comment on line 87) t
shrike
2017/02/02 16:12:50
Thank you brucedawson@. I saw the comment about ro
| |
| 90 } | 90 } |
| 91 #else | 91 #else |
| 92 int ProcessMetrics::GetIdleWakeupsPerSecond() { | 92 int ProcessMetrics::GetIdleWakeupsPerSecond() { |
| 93 NOTIMPLEMENTED(); // http://crbug.com/120488 | 93 NOTIMPLEMENTED(); // http://crbug.com/120488 |
| 94 return 0; | 94 return 0; |
| 95 } | 95 } |
| 96 #endif // defined(OS_MACOSX) || defined(OS_LINUX) | 96 #endif // defined(OS_MACOSX) || defined(OS_LINUX) |
| 97 | 97 |
| 98 } // namespace base | 98 } // namespace base |
| OLD | NEW |