mirror of
https://github.com/openhardwaremonitor/openhardwaremonitor
synced 2025-08-31 14:25:16 +00:00
Fixed the initialization of the TSC estimating code.
This commit is contained in:
@@ -64,8 +64,6 @@ namespace OpenHardwareMonitor.Hardware.CPU {
|
||||
|
||||
private double timeStampCounterMultiplier;
|
||||
|
||||
private StringBuilder debug = new StringBuilder();
|
||||
|
||||
public AMD10CPU(int processorIndex, CPUID[][] cpuid, ISettings settings)
|
||||
: base(processorIndex, cpuid, settings)
|
||||
{
|
||||
@@ -180,9 +178,6 @@ namespace OpenHardwareMonitor.Hardware.CPU {
|
||||
CultureInfo.InvariantCulture));
|
||||
r.AppendLine();
|
||||
|
||||
r.Append(debug);
|
||||
r.AppendLine();
|
||||
|
||||
return r.ToString();
|
||||
}
|
||||
|
||||
|
@@ -119,14 +119,24 @@ namespace OpenHardwareMonitor.Hardware.CPU {
|
||||
ActivateSensor(totalLoad);
|
||||
}
|
||||
|
||||
if (hasTimeStampCounter)
|
||||
estimatedTimeStampCounterFrequency = EstimateTimeStampCounterFrequency();
|
||||
else
|
||||
estimatedTimeStampCounterFrequency = 0;
|
||||
timeStampCounterFrequency = estimatedTimeStampCounterFrequency;
|
||||
if (hasTimeStampCounter) {
|
||||
estimatedTimeStampCounterFrequency =
|
||||
EstimateTimeStampCounterFrequency();
|
||||
|
||||
// set initial values
|
||||
uint lsb, msb;
|
||||
WinRing0.RdtscTx(out lsb, out msb, (UIntPtr)1);
|
||||
lastTime = Stopwatch.GetTimestamp();
|
||||
lastTimeStampCount = ((ulong)msb << 32) | lsb;
|
||||
|
||||
lastTimeStampCount = 0;
|
||||
lastTime = 0;
|
||||
} else {
|
||||
estimatedTimeStampCounterFrequency = 0;
|
||||
|
||||
lastTime = 0;
|
||||
lastTimeStampCount = 0;
|
||||
}
|
||||
|
||||
timeStampCounterFrequency = estimatedTimeStampCounterFrequency;
|
||||
}
|
||||
|
||||
private static double EstimateTimeStampCounterFrequency() {
|
||||
|
@@ -37,5 +37,5 @@
|
||||
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyVersion("0.1.37.23")]
|
||||
[assembly: AssemblyInformationalVersion("0.1.37.23 Alpha")]
|
||||
[assembly: AssemblyVersion("0.1.37.24")]
|
||||
[assembly: AssemblyInformationalVersion("0.1.37.24 Alpha")]
|
Reference in New Issue
Block a user