generated from Vortron-rd/c-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commands
Vortron-rd edited this page Jul 6, 2025
·
5 revisions
Below is a quick list of some commands in LibHPD to get you started. It is highly recommended that you understand /proc/stat to a minimum degree before attempting to use these. You should also read the source files to get a better understanding of the commands.
int cpust(int stat, int core)
Returns the total clock ticks that a core has spent on a specific type of task. Set core=-1 to pull data from all cores. The first argument corresponds to a column on /proc/stat. Below is a quick reference:
stats:
- user
- nice
- system
- idle
- iowait
- irq
- softirq
- steal
- guest
- guest_nice
Example:
int main() {
int core7idletime = cpust(4,7);
fprintf("This is the amount of clock cycles core 7 has spent idling: %s\n",core7idletime);
}