Created
March 18, 2015 22:15
-
-
Save rothwerx/065fbdfd5eec6aa56e1f to your computer and use it in GitHub Desktop.
C: Print the USER_HZ for a platform
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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