Comments affecting runtime?

Revision en1, by TooDumbToWin, 2016-07-30 01:12:22

I ran these codes in custom invocation and got weird running times.


#include<bits/stdc++.h> using namespace std; int main(){ //Hi for(int i=0;i<5000000;i++)cout<<i<<" "; return 0; }

Run time: 2448 ms


#include<bits/stdc++.h> using namespace std; int main(){ for(int i=0;i<5000000;i++)cout<<i<<" "; return 0; }

Run time: 2901 ms

Can anyone explain why adding comment is having significant impact on running times?

PS: Changing comment affected run time slightly as well.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English TooDumbToWin 2016-07-30 01:12:22 581 Initial revision (published)