If you ever get a leg cramp, the absolute fastest way to get rid of it with very little "echo" pain after is to stand up and put like 70% of your weight on it and keep it mostly straight. I used all the other methods over the years, and nothing gets rid of a hamstring or especially calve cramp faster than just standing up and putting weight on it.
Though it is hilarious to try to scramble and get to your feet with your leg cramping, especially if you're by yourself in your room wanking it when it happens, and don't pretend that's never happened to you.
EDIT: Also, if you have regular issues with cramps, drink more water and make sure you're getting enough Potassium/magnesium/sodium in your diet.