title: Get a timestamp in C in microseconds?
body: <p>How do I get a microseconds timestamp in C?</p>
  
  <p>I'm trying to do:</p>
  
  <pre><code>struct timeval tv;
  gettimeofday(&amp;tv,NULL);
  return tv.tv_usec;
  </code></pre>
  
  <p>But this returns some nonsense value that if I get two timestamps, the second one can be smaller or bigger than the first (second one should <strong>always</strong> be bigger). Would it be possible to convert the magic integer returned by <strong>gettimeofday</strong> to a normal number which can actually be worked with?</p>