[+] AuHwInfo::GetProcessCPUUtilization

This commit is contained in:
Reece Wilson 2023-10-28 16:10:25 +01:00
parent bdf5b44cd3
commit 178d2d79a7
2 changed files with 8 additions and 0 deletions

View File

@ -25,4 +25,6 @@ namespace Aurora::HWInfo
((AuUInt32, bTriggered), (bool, bThreadMode)),
AuUInt32 uMinSamplePeriodMS = AuSToMS<AuUInt32>(1), // May be zero
bool bThreadMode = false); // False = Sample Process Usage | True = Sample Thread Usage
AUKN_SYM double GetProcessCPUUtilization();
}

View File

@ -102,6 +102,12 @@ namespace Aurora::HWInfo
}
}
AUKN_SYM double GetProcessCPUUtilization()
{
static CpuLoadSamplerImpl gSampler(AuSToMS<AuUInt32>(1), false);
return gSampler.GetLoad();
}
AUKN_SYM ICpuLoadSampler *CpuLoadSamplerNew(AuUInt32 uMinSamplePeriodMS,
bool bThreadMode)
{