title: gettimeofday() C++ Inconsistency
body: <p>I'm doing a project that involves comparing programming languages.  I'm computing the Ackermann function.  I tested Java, Python, and Ruby, and got responses between 10 and 30 milliseconds.  But C++ seems to take 125 milliseconds.  Is this normal, or is it a problem with the <code>gettimeofday()</code>?  <code>Gettimeofday()</code> is in time.h.</p>
  
  <p>I'm testing on a (virtual) Ubuntu Natty Narwhal 32-bit.  I'm not short processing power (Quad-core 2.13 GHz Intel Xeon).</p>
  
  <p>My code is here:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;sys/time.h&gt;
  using namespace std;
  int a(int m,int n) {
      if (m == 0) {
      return n + 1;
      } else if (m &gt; 0 and n == 0) {
      return a(m-1,1);
      } else if (m &gt; 0 and n &gt; 0) {
      return a(m-1,a(m,n-1));
      }
  }
  
  int main() {
      timeval tim;
      gettimeofday(&amp;tim,NULL);
      double t1 = tim.tv_usec;
      int v = a(3,4);           
      gettimeofday(&amp;tim,NULL);
      double t2 = tim.tv_usec;
      cout &lt;&lt; v &lt;&lt; endl &lt;&lt; t2-t1;
      return 0;
  }       
  </code></pre>