title: How to combine time from tv_sec and tv_usec into one entity? What is safe?
body: <p>So I need to do some precision timing and am endeavoring to use tv_sec and tv_usec. Right now I, super messily, have a vector of my own home-rolled Tuple class, holding both secs and microsecs.</p>
  
  <p>The issue here is... if i want to say... get the oldest of the entries in my vector, I have to do super hairy and gross comparisons between the values in the tuples.</p>
  
  <p>I'd really like to combine tv_sec and tv_usec into a single value to store. This would make comparison very easy. </p>
  
  <p>But how does one do this safely? Is this attempt below going to blow up in my face for certain values, for example?</p>
  
  <pre><code>gettimeofday(&amp;tv, NULL);
  time_t secs = tv.tv_sec;
  time_t msecs = tv.tv_usec;
  double the_answer = tv_sec + (1.0/1000000) * tv_usec; //ehhhh? Maybe?
  </code></pre>
  
  <p>I spose the question boils down to - will overflow/act weird/ruin me if I use it:</p>
  
  <pre><code>    double the_answer = tv_sec + (1.0/1000000) * tv_usec; //ehhhh? Maybe?
  </code></pre>