I read about this years ago, but it doesn’t seem to be common knowledge.
Cramps are caused by local oxygen deprivation in the affected muscles. Rapid, deep breathing gets rid of them quickly by restoring oxygen to the area.
Breathe as rapidly and as deeply as you can without becoming dizzy. If you catch the cramp just as it is beginning, you can usually stop it. If it’s already got a head start, it may take a minute.
At first nothing seems to be happening, then as the increased oxygen reaches the area, the cramp fades out and stops. – J.W.
Low blood oxygen (hypoxia) is certainly one cause of cramps often experienced by those with asthma or other breathing conditions, but there are other causes too. For the most part, this is a quick method of fixing that particular type of cramp. You can do it yourself quickly without causing harm (except in rare cases – You already know if you are one of those rare cases). If it fixes the issue, you are good to go. If not, you haven’t lost anything and you can move on to the next level of treatment.