mirror of
https://github.com/openhardwaremonitor/openhardwaremonitor
synced 2025-08-29 13:28:04 +00:00
Replaced the more expensive calls to DateTime.Now with DateTime.UtcNow.
This commit is contained in:
parent
169eaf3edf
commit
acbae6c98d
@ -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<float> timeGrid = GetTimeGrid();
|
||||
List<float> tempGrid = GetTemperatureGrid();
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user