title: Why is clock_nanosleep preferred over nanosleep to create sleep times in C?
body: <p>Which one of the two functions is better </p>
  
  <pre><code>#include &lt;time.h&gt;
  int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *rqtp, struct timespec *rmtp);
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>#include &lt;time.h&gt;
  int nanosleep(const struct timespec *rqtp, struct timespec *rmtp);
  </code></pre>