I actually was hoping someone else had come up with a good answer.
I suppose the obvious one is think about your technique, count strokes, or imagine yourself in a race. I find myself doing a sort of internal chanting toward the end of the workout- thinking the lap number I'm on with each stroke. It's weird, but it helps keep me focused and calm and obviously keeps me from losing count of my laps. Probably helps with rhythm too.
Chat with our AI personalities