diff --git a/atom/common/api/atom_bindings.cc b/atom/common/api/atom_bindings.cc index d8c21d635093..c2b158b0ce23 100644 --- a/atom/common/api/atom_bindings.cc +++ b/atom/common/api/atom_bindings.cc @@ -188,7 +188,14 @@ v8::Local AtomBindings::GetCPUUsage(v8::Isolate* isolate) { int processor_count = base::SysInfo::NumberOfProcessors(); dict.Set("percentCPUUsage", metrics_->GetPlatformIndependentCPUUsage() / processor_count); + + // NB: This will throw NOTIMPLEMENTED() on Windows + // For backwards compatibility, we'll return 0 +#if !defined(OS_WIN) dict.Set("idleWakeupsPerSecond", metrics_->GetIdleWakeupsPerSecond()); +#else + dict.Set("idleWakeupsPerSecond", 0); +#endif return dict.GetHandle(); } diff --git a/docs/api/structures/cpu-usage.md b/docs/api/structures/cpu-usage.md index b700d4945f0f..abb5e15c2f20 100644 --- a/docs/api/structures/cpu-usage.md +++ b/docs/api/structures/cpu-usage.md @@ -3,4 +3,5 @@ * `percentCPUUsage` Number - Percentage of CPU used since the last call to getCPUUsage. First call returns 0. * `idleWakeupsPerSecond` Number - The number of average idle cpu wakeups per second - since the last call to getCPUUsage. First call returns 0. + since the last call to getCPUUsage. First call returns 0. Will always return 0 on + Windows.