[font=courier new][size=8pt]I didn't even know that I had "gcc" on my (Windows) machine. I don't remember when or how I got it.
Anyway, I was unsure if maybe I did have it, so, from the the command line I typed, "gcc", and it responded, "gcc: no input files". So, then I knew I had it.
So, I compiled both versions, using jack's command,
"gcc main.c -O3 -o main".
I guess that "O3", must mean, super optimization.
I ran both versions three times. Here are the results (in seconds):
slow version --> 16.076, 15.334, 15.084
fast version --> 11.877, 11.744, 11.872
gcc is good, and, free.
(Now I use your tip, Kent, to open a command window in the folder where the source files reside (shift - right click). Previously, I would open a command window, and then type, "cd c:\users\root\desktop\c", for instance. And, many times, I would have a spelling error, and then have to re-type most of the line - very primitive, very frustrating.)
Dan
Bookmarks