title: Time Sampling Problems with gprof
body: <p>I am attempting to profile some c++ code, compiled with g++ including the option -pg, using gprof. However, in spite of the fact that the program takes 10-15 minutes to run on my computer (with the CPU maxed out), the % time, cumulative seconds and self seconds columns of the table produced by gprof are entirely 0.00s! The calls column contains correct looking data, for example over 150,000 calls to a basic function. Here is a sample of the data collected:</p>
  
  <pre><code>  %   cumulative   self              self     total           
  
   time   seconds   seconds    calls  Ts/call  Ts/call  name
  
    0.00      0.00     0.00   156012     0.00     0.00  perm::operator[](int) const
  
    0.00      0.00     0.00   153476     0.00     0.00  perm::perm(void)
  </code></pre>
  
  <p>The program doesn't use strings and the only #include is iostream (only used for outputting the final answer) so it can't be slow because of string finds and compares or other similar slow external functions as suggested in this question: <a href="https://stackoverflow.com/questions/1287728/unable-to-accumulate-time-using-gprof-the-gnu-profiler">unable to accumulate time using gprof - the gnu profiler</a></p>
  
  <p>The program itself exits fine and I have no reason to believe that the profile data isn't being written correctly (as was suggested here: <a href="https://stackoverflow.com/questions/1030829/gprof-reports-no-time-accumulated">gprof reports no time accumulated</a>) </p>
  
  <p>As this is all being done in windows 7, trying to use Shark or Valgrind isn't an option.</p>
  
  <p>Is there a reason that it is recording 0.00s being spent in each function?</p>