Create a circle shape layer using only stroke. Twirl open the stroke, dashes and click the plus sign to create a dash and change the Line Cap to Round Cap. Now animate the "Gap" from O to 70 to 0(or whatever looks good, depends on your stroke width).
Next use the "Add" fly out to add a "Trim Paths". Animate the Start from 0 to 100% and animate the offset from 0 to 360. To each parameter, add the expression(alt+click stopwatch): loopOut("pingpong")
Now you can play around with those parameters and it will just automatically adjust. Check out this example project:
"I have not failed 700 times. I have succeeded in proving that those 700 ways will not work. When I have eliminated the ways that will not work, I will find the way that will work."
---THOMAS EDISON on inventing the light bulb.