title: Added a for loop to my code, and it seemed to have run faster, how is this possible?
body: <p>I added a for loop to specifically slow down my code for an assignment so that I would not appear as high on the leaderboards so that later I could take the top spot on this assignment.  In any case, I decided to try to add a for loop to waste time. Here is what I added to the beginning:</p>
  
  <pre><code>for (int i = 0; i &lt;= 123456; i++){ std::cout &lt;&lt; "" &lt;&lt; "" &lt;&lt; "";}
  </code></pre>
  
  <p>Effectively that is what I added.  Once the time got back to me it was lower.</p>
  
  <p>My guess is that either the compiler optimized out the whole section, and due to the other processes the computer that graded the assignment was running at the time it was a little less busy and ran faster, or somehow the compiler was able to use some part of this to optimize the code a little bit. I'm just curious if the answer is one of these 2, or something more obscure that might surprise me.</p>
  
  <p>I was using the g++ compiler with the -O2 argument if it makes a difference.</p>
  
  <p>thanks.</p>