Well, actually Order 66 took place in the middle of the war. Right after Order 66, Darth Vader wiped out the Separatist leaders, putting an end to the civil war.
Cause ol palp's kept tabs on them. Palpatine could of done that at ANYTIME he so chose. The clone wars was a SHAM.
It was a pretext to do 2 things. 1 get rid of the jedi, 2 cement him as undisputed ruler of the galaxy.
If you remember ep III when obi-wan was talking to Padme to find Anakin right before Mustafar. What he said about the war hit the nail right on the head.