Index: content/browser/power_profiler/power_data_provider_ia_win.cc |
diff --git a/content/browser/power_profiler/power_data_provider_ia_win.cc b/content/browser/power_profiler/power_data_provider_ia_win.cc |
index 597e3bd73ac53730372ab386ee9e3e6db6ede4c3..2127ae299734b293b6a68b5c08e33b7f77475f00 100644 |
--- a/content/browser/power_profiler/power_data_provider_ia_win.cc |
+++ b/content/browser/power_profiler/power_data_provider_ia_win.cc |
@@ -4,10 +4,16 @@ |
#include "content/browser/power_profiler/power_data_provider_ia_win.h" |
+#include "base/basictypes.h" |
#include "base/logging.h" |
namespace content { |
+// Default sampling period, as recommended by Intel Power Gadget. |
+// Section 3.1 of |
+// http://software.intel.com/en-us/blogs/2013/10/03/using-the-intel-power-gadget-api-on-windows |
+const int kDefaultSamplePeriodMs = 50; |
+ |
scoped_ptr<PowerDataProvider> PowerDataProvider::Create() { |
scoped_ptr<PowerDataProviderIA> provider(new PowerDataProviderIA()); |
if (provider->Initialize()) |
@@ -54,6 +60,10 @@ PowerEventVector PowerDataProviderIA::GetData() { |
return events; |
} |
+base::TimeDelta PowerDataProviderIA::GetSamplingRate() { |
+ return base::TimeDelta::FromMilliseconds(kDefaultSamplePeriodMs); |
+} |
+ |
bool PowerDataProviderIA::Initialize() { |
if (is_open_) |
return true; |