cout == slow (prime numbers)
i've been working on a prime number program on and off since last year and i thought everyone (who doesn't know this already) how slow cout really is. for example when running my program and couting all the primes between 1 and 10 million my program completed in 125.5 seconds whereas w/ cout commented out, the program ran in 17.7 seconds!!!
also, if any1 knows how fast direct access files are (in a vague comparision to whatever you can think of...) it would be nice. i am planning on implementing them to hold the found prime numbers.
thanks for the responses guys
at the moment there is no output because of the huge speed difference... (well aside from the gettime output at the end)
the program actually finds all the primes and doesn't just guess which numbers are primes
so are creatfile() and writefile() faster than direct access?
basically at this point im hoping to make a program that runs fast (albeit slower than at the moment) that uses files so i have some sort of hardcopy of the primes found.