If cramps bother you frequently, consult with your doctor, who may advise you to keep a cramp diary to try to pinpoint or prevent the problem -- what were you doing at the time, how long did it last, what did you do to make it feel better, what did you do earlier in the day?
CNN: What causes muscle cramps?