Originally Posted by
Paul McKenzie
1) Please format your code before posting.
2) You didn't mention the compiler or the compiler version you're using.
3) Your code has errors -- a
a) main() returns an int, not void.
b) Given a), you can't return void from main(). Your return statement is a void return, and that is not allowed if main() must return an int.
4) Your code does not calculate just the time to compute pi to 10000 places.
To point 4) why are you timing output statements such as cout? Get rid of it. That by itself adds seconds to the amount of time. After getting rid of the cout statements in the middle of the calculation, the time is cut down to a little over 9 seconds. (This is with Visual Studio 2010, optimized build).
9.159 seconds.
Regards,
Paul McKenzie