title: Understanding about clock() and CLOCKS_PER_SEC in C++
body: <p>I am interested in accurately timing a c++ application. There seems to be multiple definitions for "time", but for the sake of this question... I am interested in the time that I am counting on my watch in the real world... if that makes any sense! Anyway, in my application, my start time is done like this:</p>
  
  <pre><code>clock_t start = clock();
  .
  .
  . // some statements
  .
  .
  clock_t end = clock();
  .
  .
  double duration = end - start;
  .
  .
  cout &lt;&lt; CLOCKS_PER_SEC &lt;&lt; endl;
  </code></pre>
  
  <p><strong>start</strong> is equal to 184000
  <strong>end</strong> is equal to 188000
  <strong>CLOCKS_PER_SEC</strong> is equal to 1000000</p>
  
  <p>Does this mean the duration (in seconds) is equal to 4000/1000000 ? If so, this would mean the duration is .004 seconds? Is there a more accurate way of measuring this?</p>
  
  <p>Thank you</p>