One of the things I used to do was set targets. 100 pedals strokes, perhaps (one on tour, there were some long, hard hills towards the end, and that's the only way I could get through without walking... counting, then stopping. Sometimes, I'd get to 150 or 200).
Then you might use power or telephone poles, or 10 corners, or whatever. Resting does help the legs recover a little before the next bit.