Merge pull request #2681 from tactikauan/master

This commit is contained in:
Alexis Rouillard 2023-11-19 14:20:54 +01:00 committed by GitHub
commit c299ea9369
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -21,8 +21,9 @@ std::vector<std::tuple<size_t, size_t>> waybar::modules::CpuUsage::parseCpuinfo(
size_t idle_time = 0;
size_t total_time = 0;
if (times.size() >= 4) {
idle_time = times[3];
if (times.size() >= 5) {
// idle + iowait
idle_time = times[3] + times[4];
total_time = std::accumulate(times.begin(), times.end(), 0);
}
cpuinfo.emplace_back(idle_time, total_time);