i am using Dev-c++ version 5.11 and running a c++ code.
#include <iostream>
#include <time.h>
using namespace std ;
int main()
{
int start = clock();
for(int x = 0; x <=100000; x++)
{
cout << x << endl;
}
int stop = clock();
cout << endl;
cout << (stop-start)/double(CLOCKS_PER_SEC);
return 0;
}
It is taking 80sec - 75sec on windows 8.1 pavilion g6 2.5Ghz but in python it executes in under 3 seconds how to decrease execution time in c++ code.
Python Code -- (Pycharm python ver.3)
import time as t
num = 100000
start = t.time()
for z in range(0, num):
print(z)
print(t.time() - start)
execution time - 2.95 seconds