Optimal swimming is on a 20 frame cycle; there are 13 frames where pressing A will be too early and do nothing, then 7 frames where pressing A will result in maximum speed. Regardless of when the A button is pressed in the 7 frame window, this 20 frame cycle will repeat.