There's really two scenarios there. Either the earth is moving enough that run as fast as you can is zero mph, because the earth is moving a lot or you could move rather quickly and so there's not much need to move.
If you're in an immediately hazardous area, you should move to nearby safety during the earthquake (getting away from kitchens, window, things that could fall on you, etc), but exiting a building during an earthquake is probably riskier than staying inside it.
Certainly, use the time of the shaking to plan your exit, but no sense in falling all over the place and risking avoidable injury.
If you're in the bay area, chances are the building you're in is fairly earthquake safe. Building codes have improved over time, and many of the most unsafe buildings were destroyed in previous large earthquakes. Small buildings tend to be fairly safe even if not up to current codes, and large buildings tend to be targetted by inspection and retrofit requirements.