mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 00:03:58 +01:00
CPUUsage / DiskIO / NetIO: add option waitTime
This commit is contained in:
@@ -13,7 +13,7 @@ void ffPrepareCPUUsage(void)
|
||||
ffGetCpuUsageInfo(&cpuTimes1);
|
||||
}
|
||||
|
||||
const char* ffGetCpuUsageResult(FFlist* result)
|
||||
const char* ffGetCpuUsageResult(FFCPUUsageOptions* options, FFlist* result)
|
||||
{
|
||||
const char* error = NULL;
|
||||
if(cpuTimes1.elementSize == 0)
|
||||
@@ -21,7 +21,7 @@ const char* ffGetCpuUsageResult(FFlist* result)
|
||||
ffListInit(&cpuTimes1, sizeof(FFCpuUsageInfo));
|
||||
error = ffGetCpuUsageInfo(&cpuTimes1);
|
||||
if(error) return error;
|
||||
ffTimeSleep(200);
|
||||
ffTimeSleep(options->waitTime);
|
||||
}
|
||||
|
||||
if(cpuTimes1.length == 0) return "No CPU cores found";
|
||||
@@ -43,7 +43,7 @@ retry:
|
||||
if (++retryCount <= 3)
|
||||
{
|
||||
ffListClear(&cpuTimes2);
|
||||
ffTimeSleep(200);
|
||||
ffTimeSleep(options->waitTime);
|
||||
goto retry;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,4 +8,4 @@ typedef struct FFCpuUsageInfo {
|
||||
} FFCpuUsageInfo;
|
||||
const char* ffGetCpuUsageInfo(FFlist* cpuTimes);
|
||||
|
||||
const char* ffGetCpuUsageResult(FFlist* result); // list of double
|
||||
const char* ffGetCpuUsageResult(FFCPUUsageOptions* options, FFlist* result); // list of double
|
||||
|
||||
Reference in New Issue
Block a user