title: c timeval vs timespec
body: <p>Apart from the difference of precision, what are the differences between <code>struct timeval</code> and <code>struct timespec</code>? If I need less precision than µs (say, milliseconds), why would I use one over the other?</p>
  
  <p>On my compiler (gcc for ARM):</p>
  
  <pre><code>/* POSIX.1b structure for a time value.  This is like a `struct timeval' but
     has nanoseconds instead of microseconds.  */
  struct timespec
    {
      __time_t tv_sec;        /* Seconds.  */
      __syscall_slong_t tv_nsec;  /* Nanoseconds.  */
    };
  
  /* A time value that is accurate to the nearest
     microsecond but also has a range of years.  */
  struct timeval
    {
      __time_t tv_sec;        /* Seconds.  */
      __suseconds_t tv_usec;  /* Microseconds.  */
    };
  </code></pre>
  
  <p>With both <code>__syscall_slong_t</code> and <code>__suseconds_t</code> defined as a "long word".</p>