mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
38b3aae1e3
by making C++ code more C++
19 lines
431 B
C++
19 lines
431 B
C++
extern "C" {
|
|
#include "cpuUsage.h"
|
|
}
|
|
#include "util/windows/wmi.hpp"
|
|
|
|
extern "C" const char* ffGetCpuUsageResultNoWait(double* result)
|
|
{
|
|
FFWmiQuery query(L"SELECT LoadPercentage FROM Win32_Processor");
|
|
if(!query)
|
|
return "Query WMI service failed";
|
|
|
|
if(FFWmiRecord record = query.next())
|
|
record.getReal(L"LoadPercentage", result);
|
|
else
|
|
return "No WMI result returned";
|
|
|
|
return nullptr;
|
|
}
|