title: calculate running time of a huge c++ program
body: <p>the suggested method of estimating the time is using the clock() function and then dividing the count of cpu cycles by cycles/second.</p>
  
  <p>My problem is that the program i am trying to run takes a lot of time (in hours). This means the clock() function (that returns a long int) returns a garbage value (because max long int is not big enough for this)</p>
  
  <p>Any suggestions (apart from estimating time for internal loops and adding them up or something) ?</p>
  
  <pre><code>long t1 = clock();
  function();
  long t2=clock();
  
  time = ((double)t2 - t1) / CLOCKS_PER_SEC
  </code></pre>