bring back cpu temp

pull/20/head
FlightlessMango 4 years ago
parent 1a60999243
commit c9e9c2feaf

@ -53,21 +53,6 @@ string exec(string command) {
void *cpuInfo(void *){
FILE *cpuInfo = fopen("/proc/cpuinfo", "r");
char line[256];
int i = 0;
while (fgets(line, sizeof(line), cpuInfo)) {
std::string row;
row = line;
if (row.find("MHz") != std::string::npos){
row = std::regex_replace(row, std::regex(R"([^0-9.])"), "");
// cpuArray[i + 1].freq = stoi(row);
i++;
}
}
fclose(cpuInfo);
char buff[6];
rewind(cpuTempFile);
fflush(cpuTempFile);

@ -915,6 +915,7 @@ static void snapshot_swapchain_frame(struct swapchain_data *data)
cpuLoadLog += cpuData.percent;
cpuLoadLog = cpuLoadLog / cpuStats.GetCPUData().size();
pthread_create(&cpuInfoThread, NULL, &cpuInfo, NULL);
// get gpu usage
if (deviceName.find("GeForce") != std::string::npos)

Loading…
Cancel
Save