mirror of
https://github.com/openhardwaremonitor/openhardwaremonitor
synced 2025-08-30 22:05:08 +00:00
Replaced the more expensive calls to DateTime.Now with DateTime.UtcNow.
This commit is contained in:
@@ -155,7 +155,7 @@ namespace OpenHardwareMonitor.GUI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnPaint(PaintEventArgs e) {
|
protected override void OnPaint(PaintEventArgs e) {
|
||||||
now = DateTime.Now - new TimeSpan(0, 0, 4);
|
now = DateTime.UtcNow - new TimeSpan(0, 0, 4);
|
||||||
|
|
||||||
List<float> timeGrid = GetTimeGrid();
|
List<float> timeGrid = GetTimeGrid();
|
||||||
List<float> tempGrid = GetTemperatureGrid();
|
List<float> tempGrid = GetTemperatureGrid();
|
||||||
|
@@ -134,7 +134,7 @@ namespace OpenHardwareMonitor.Hardware {
|
|||||||
}
|
}
|
||||||
} catch { }
|
} catch { }
|
||||||
if (values.Count > 0)
|
if (values.Count > 0)
|
||||||
AppendValue(float.NaN, DateTime.Now);
|
AppendValue(float.NaN, DateTime.UtcNow);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AppendValue(float value, DateTime time) {
|
private void AppendValue(float value, DateTime time) {
|
||||||
@@ -193,7 +193,7 @@ namespace OpenHardwareMonitor.Hardware {
|
|||||||
return currentValue;
|
return currentValue;
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
DateTime now = DateTime.Now;
|
DateTime now = DateTime.UtcNow;
|
||||||
while (values.Count > 0 && (now - values.First.Time).TotalDays > 1)
|
while (values.Count > 0 && (now - values.First.Time).TotalDays > 1)
|
||||||
values.Remove();
|
values.Remove();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user