another reason why you might have cramps could be that you didn't drink enough water. Just to make sure before any hard training, you should always drink lots of water till you're full and then just pee out the excess. I would start drinking water 1hr before and then you should have enough time for the excess water to come out.
Personally, one hour is more than enough. A lot times all I need half an hour before I train and then I'm ready.
Don't drink too much though. Drink only till you're full.