Counting is a strangely powerful tool for enduring through something. Standard advice when you're angry is to count to ten. When stretching counting to a target number helps sustain the stretch longer.

A good counting based technique for endurance is box breathing. It involves repeatedly inhaling to a count of 4, holding to a count of 4, exhaling to a count of 4 and holding to a count of 4. This is a technique used by Navy SEALs to induce calm and focus. I've personally found it effective for lengthening a cold shower.