title: What is the unit of gettimeofday()?
body: <p>I've a program to calculate the latency of an object in a pub-sub model. I've used the following function for timestamp:</p>
  
  <pre><code>uint64_t GetTimeStamp() {
      struct timeval tv;
      gettimeofday(&amp;tv,NULL);
      return tv.tv_sec*(uint64_t)1000000+tv.tv_usec;
  }
  </code></pre>
  
  <p>The latency is measured as timestamp difference in publisher and subscriber. So, I'm concerned about the unit of the latency measured. Is it in seconds or microseconds??</p>