I do this so much that I quite often find myself pacing around, then wonder exactly how long I've been doing it. When my mind starts cogitating, it seems I can get up out of my chair and begin pacing without even noticing the transition.
So long as there are no obstacles in my path, I always pace in anti-clockwise circuits rather than backwards-forwards in a line, and for a really satisfying stim, on tip-toes. I'm also very particular about not being seen or heard doing it - even when I'm in a situation where I know "spectators" would be happy to tolerate it (e.g. when in the company of other autistic people). Because of that, I have become very expert at pacing silently - I have a "mental-map" of every squeaky floorboard in the places I have lived. I find that concentrating on doing it as quietly as I can is in itself very therapeutic - like a form of active meditation or mindfulness (I can't sit still long enough for the usual kind of "meditation").
I get a similar effect from doing a mildly strenuous walk too. I generally choose to walk wherever I need to go unless the distance/time is prohibitive, and have always lasted longer in jobs where I could commute on foot rather than beginning/ending the work day with the stress of dealing with public transport (or indeed, just the public!). Thankfully, this also means that I get some regular exercise - I've never liked sports, and don't like the atmosphere of gyms etc., so would probably end up being a complete "couch-potato" if I didn't getting out for a walk around the neighbourhood.
As FandomConnection said, I also find pacing really helpful when I need to think something through. In jobs that I had in the past, I often wished that it was more acceptable to get up and walk around a little to get my mind working, instead of being expected to remain at the workstation completely stalled with a "mental block". A short burst of the pacing stim is also the only thing that really calms the physical restlessness and fidgeting - I couldn't comfortably sit all the way through a feature film without burning off some of that physical energy first.
_________________
When you are fighting an invisible monster, first throw a bucket of paint over it.