Don't update CPU freq/temp if not enabled

This commit is contained in:
jackun 2020-03-14 18:47:03 +02:00
parent 6bbc89a9cc
commit 9a7a4d99e0
No known key found for this signature in database
GPG Key ID: 119DB3F1D05A9ED3
2 changed files with 6 additions and 2 deletions

View File

@ -150,8 +150,6 @@ bool CPUStats::Init()
//TODO take sampling interval into account?
bool CPUStats::UpdateCPUData()
{
CPUStats::UpdateCoreMhz();
CPUStats::UpdateCpuTemp();
unsigned long long int usertime, nicetime, systemtime, idletime;
unsigned long long int ioWait, irq, softIrq, steal, guest, guestnice;
int cpuid = -1;

View File

@ -908,9 +908,15 @@ void update_hud_info(struct swapchain_stats& sw_stats, struct overlay_params& pa
}
if (sw_stats.last_fps_update) {
if (elapsed >= params.fps_sampling_period) {
if (params.enabled[OVERLAY_PARAM_ENABLED_cpu_stats]) {
cpuStats.UpdateCPUData();
sw_stats.total_cpu = cpuStats.GetCPUDataTotal().percent;
if (params.enabled[OVERLAY_PARAM_ENABLED_core_load])
cpuStats.UpdateCoreMhz();
if (params.enabled[OVERLAY_PARAM_ENABLED_cpu_temp])
cpuStats.UpdateCpuTemp();
}
if (params.enabled[OVERLAY_PARAM_ENABLED_gpu_stats]) {