I tried a small electric thing once but the bits got chewed up almost before completing one chain. I use a round file, that I get for around $10 per dozen. Filing is fast and economical.
Clamp your saw's bar in a vice to hold it steady while you file. Then when one side is done, turn the saw upside down in the vice witht he motor still on the right, to do the other side. This keeps the motor out of your way.
Before you file, study the angels of a new chain, stick a file in the groove just right and notice the angle of the file.
As you file look at the side plate of the tooth, this is the most important angle. if you file too low you get a big C shaped sideplate angle, if you are not low enough, the sideplate will look like an L.
If you buy a Stihl chain they have little reference lines scribed on the top plate and side plate of the chain to help you file correctly.
I sharpen my chain when it gets dull, not at any time interval. Try not sticking the bar into the ground so much when you are cutting.