[*] Amended CpuLoadSampler
This commit is contained in:
parent
178d2d79a7
commit
1dd9d552bd
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user