From 13e298a9e8969a16e67bca7730f892cd372d438a Mon Sep 17 00:00:00 2001 From: Ted Date: Sat, 11 Jun 2016 15:02:45 -0700 Subject: [PATCH] Added Overall CPU and RAM resource monitors for Windows Profile. --- .../Modules/Effects/WindowsProfile/WindowsProfileModel.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Artemis/Artemis/Modules/Effects/WindowsProfile/WindowsProfileModel.cs b/Artemis/Artemis/Modules/Effects/WindowsProfile/WindowsProfileModel.cs index 906ed42e1..630f5bd01 100644 --- a/Artemis/Artemis/Modules/Effects/WindowsProfile/WindowsProfileModel.cs +++ b/Artemis/Artemis/Modules/Effects/WindowsProfile/WindowsProfileModel.cs @@ -119,6 +119,7 @@ namespace Artemis.Modules.Effects.WindowsProfile _cores.Add(null); coreCount++; } + _overallCPU = GetOverallPerformanceCounter(); } catch (InvalidOperationException) { @@ -129,7 +130,7 @@ namespace Artemis.Modules.Effects.WindowsProfile private void UpdateCpu(WindowsProfileDataModel dataModel) { - if (_cores == null) + if (_cores == null || _overallCPU == null) return; // CPU is only updated every 15 frames, the performance counter gives 0 if updated too often