Comments affecting runtime?

Правка en1, от 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.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский TooDumbToWin 2016-07-30 01:12:22 581 Initial revision (published)