Your profile says you are a 63 year old male. Were you sitting and bearing down attempting to have a bowel movement? That can cause your heart to slow down and not supply enough blood to your brain. If so, visit your medical provider (not an emergency) and see if she feels some further testing is indicated.
If you were standing there is a broad range of possibilities, perhaps you stood up to fast, possibly dehydrated, BP was low, a recent change in medication...If it was a single incident, mention it to your doctor at next visit. If it happens again, not an emergency, but see your doctor in the next few days.
If you faint or feel lightheaded or dizzy often, see your doctor today!
could be kidney stones save a sample and call your DR