[*] Amended CpuLoadSampler

This commit is contained in:
Reece Wilson 2023-10-28 19:14:30 +01:00
parent 178d2d79a7
commit 1dd9d552bd

View File

@ -48,6 +48,13 @@ namespace Aurora::HWInfo
double dUsage = 0;
double dMinSamplePeriod = double(AuMSToNS<AuUInt64>(uMinSamplePeriod));
if (!bool(this->uPrevTimes[0]))
{
this->uPrevTimes[1] = now[1];
this->uPrevTimes[0] = now[0];
return 0;
}
if (!uMinSamplePeriod ||
dDeltaSteady >= dMinSamplePeriod)
{
@ -77,13 +84,6 @@ namespace Aurora::HWInfo
#endif
}
if (!bool(this->uPrevTimes[0]))
{
this->uPrevTimes[1] = now[1];
this->uPrevTimes[0] = now[0];
return 0;
}
else
{
dUsage = dUsage * 100.0;