getting CLOCK_TICK_RATE value in linux -
I am trying to print the value of CLOCK_TICK_RATE with the following program:
#include & lt; Fcntl.h & gt; # Include & lt; Getopt.h & gt; # Include & lt; Signal.h & gt; # Include & lt; Stdio.h & gt; # Include & lt; Stdlib.h & gt; #include & lt; String.h & gt; # Include & lt; Unistd.h & gt; # Include & lt; Sys / ioctl.h & gt; # Include & lt; Sys / types.h & gt; #include & lt; Linux / kd.h & gt; #include & lt; Linux / timex.h & gt; Int main () {printf ("% d \ n", CLOCK_TICK_RATE); }
I get a compilation error:
Error: 'CLOCK_TICK_RATE' undeclared.
I looked for the definition of CLOCK_TICK_RATE, I found in Timex.h, but when I included the time x.h, CLOCK_TICK_RATE still got undeclared.
Thanks in advance.
Maybe you're looking for it?
#include & lt; Stdio.h & gt; # Include & lt; Unistd.h & gt; Int main (zero) {printf ("% ld \ n", sysconf (_SC_CLK_TCK)); Return 0; }
It is in Hertz and is generally 100.
Comments
Post a Comment