int num_steps = 1000000000;
int _tmain(int argc, _TCHAR* argv)
double x, step, sum;
DWORD start_time, end_time;
x = sum = 0.0;
step = 1.0 / (double)num_steps;
start_time = timeGetTime();
for(i = 0; i < num_steps; i++)
x = (i + 0.5) * step;
sum += 4.0 / (1.0 + x * x);
end_time = timeGetTime();
printf("PI = %.8f (Elapsed Time = %d)\\n", step * sum, end_time - start_time);
the result is that elpsed time is 16, 562ms and microsoft visual c++ is 6910ms.
why this problem happend?
i saw that intel c++ compiler much faster than microsoft compiler in some case.
thanks a lot.
Could you please provide a test case that can help recreate the issue with the compiler version you're testing with? Also, I agree with Tim, an upgrade would make sense. In addition, if you can give more details on all of the options you've used, the arch details etc., that would be helpful too...