title: wrong numbers with clock_gettime and CLOCK_PROCESS_CPUTIME_ID
body: <p>I'm on a 64bit Ubuntu 12.04 system and tried the following code:</p>
  
  <pre><code>#include &lt;unistd.h&gt;
  #include &lt;time.h&gt;
  #include &lt;stdio.h&gt;
  
  
  int
  main(void)
  {
    struct timespec user1,user2;
    struct timespec sys1,sys2;
    double user_elapsed;
    double sys_elapsed;
  
    clock_gettime(CLOCK_REALTIME, &amp;user1);
    clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &amp;sys1);
    sleep(10);
    clock_gettime(CLOCK_REALTIME, &amp;user2);
    clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &amp;sys2);
    user_elapsed = user2.tv_sec + user2.tv_nsec/1E9;
    user_elapsed -= user1.tv_sec + user1.tv_nsec/1E9;
    printf("CLOCK_REALTIME: %f\n", user_elapsed);
    sys_elapsed = sys2.tv_sec + sys2.tv_nsec/1E9;
    sys_elapsed -= sys1.tv_sec + sys1.tv_nsec/1E9;
    printf("CLOCK_PROCESS_CPUTIME_ID: %f\n", sys_elapsed);
  }
  </code></pre>
  
  <p>As I understand it, this should print something like</p>
  
  <pre><code>CLOCK_REALTIME: 10.000117
  CLOCK_PROCESS_CPUTIME_ID: 10.001
  </code></pre>
  
  <p>But in my case, what I get is</p>
  
  <pre><code>CLOCK_REALTIME: 10.000117
  CLOCK_PROCESS_CPUTIME_ID: 0.000032
  </code></pre>
  
  <p>Is this the correct behaviour? If so how I can I determine the actual seconds of sys1 and sys2?</p>
  
  <p>When I change CLOCK_PROCESS_CPUTIME_ID to CLOCK_REALTIME then I get the expected result, but that's not what I want because we need the precision.</p>
  
  <p>[EDIT] Apparently CLOCK_PROCESS_CPUTIME_ID returns the actual time the cpu spent on prcessing. CLOCK_MONOTONIC seems to return the right value. But at what precision?</p>