I've had leg cramps for many years. A doctor prescribed Quinine which did a good job but you have to take them every day. I woke one day several years ago with one bad one and instead of stiffening to fight it I just relaxed and thought "Oh you just do your thing". It just faded away so fast that it left no residue of pain.
I couldn't wait till the next one to defeat. It went on like that for months and then I lost it. I couldn't do it any more. Alas.
Until a few months ago I managed it again. I fear them no longer because I can beat it and it takes not much longer than it takes to come on.
You have to be quick and stop fighting it instantly. Think relax, let it go. Overcome that renegade muscle.