From acbae6c98d0764f663e61a35d5c5c258fbc93ceb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=B6ller?= Date: Sun, 24 Jul 2011 22:12:01 +0000 Subject: [PATCH] Replaced the more expensive calls to DateTime.Now with DateTime.UtcNow. --- GUI/PlotPanel.cs | 2 +- Hardware/Sensor.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/GUI/PlotPanel.cs b/GUI/PlotPanel.cs index a6f37c9..1ab4a49 100644 --- a/GUI/PlotPanel.cs +++ b/GUI/PlotPanel.cs @@ -155,7 +155,7 @@ namespace OpenHardwareMonitor.GUI { } protected override void OnPaint(PaintEventArgs e) { - now = DateTime.Now - new TimeSpan(0, 0, 4); + now = DateTime.UtcNow - new TimeSpan(0, 0, 4); List timeGrid = GetTimeGrid(); List tempGrid = GetTemperatureGrid(); diff --git a/Hardware/Sensor.cs b/Hardware/Sensor.cs index 9c8e175..10e52f1 100644 --- a/Hardware/Sensor.cs +++ b/Hardware/Sensor.cs @@ -134,7 +134,7 @@ namespace OpenHardwareMonitor.Hardware { } } catch { } if (values.Count > 0) - AppendValue(float.NaN, DateTime.Now); + AppendValue(float.NaN, DateTime.UtcNow); } private void AppendValue(float value, DateTime time) { @@ -193,7 +193,7 @@ namespace OpenHardwareMonitor.Hardware { return currentValue; } set { - DateTime now = DateTime.Now; + DateTime now = DateTime.UtcNow; while (values.Count > 0 && (now - values.First.Time).TotalDays > 1) values.Remove();