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

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -