Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
C: Print the USER_HZ for a platform
/* CPU values in /proc/stat are measured in USER_HZ which is
generally 1/100th of a second, but you can verify with this.
#include <unistd.h>
#include <stdio.h>
int main()
printf("USER_HZ is %d\n", sysconf(_SC_CLK_TCK));
return 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment