Skip to content

Instantly share code, notes, and snippets.

@rothwerx
Created March 18, 2015 22:15
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save rothwerx/065fbdfd5eec6aa56e1f to your computer and use it in GitHub Desktop.
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.
See http://man7.org/linux/man-pages/man5/proc.5.html
*/
#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