1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:57:44 +00:00

WindowServer: Let the CPU monitor keep /proc/all open between refreshes.

Just seek to the beginning on every iteration and start over. This avoids
a bunch of syscalls.
This commit is contained in:
Andreas Kling 2019-04-15 23:57:31 +02:00
parent 30b0e5f82e
commit bc6ac1c2f2
2 changed files with 7 additions and 4 deletions

View file

@ -1,6 +1,7 @@
#pragma once
#include <AK/CircularQueue.h>
#include <stdio.h>
class Painter;
class Rect;
@ -18,5 +19,6 @@ private:
void get_cpu_usage(unsigned& busy, unsigned& idle);
CircularQueue<float, 30> m_cpu_history;
FILE* m_fp { nullptr };
bool m_dirty { false };
};