This is a cloudy question since many variables can cause transient alteration of consciousness. These alterations of consciousness include fainting, a reduction of blood pressure, which is very common in young people, an alteration in heart rhythm that is more common in older people, effects of medication and psychological events, such as hallucinations.
Fitness & Diving
As with epilepsy, any loss of consciousness underwater is likely to have a bad outcome. When diving using nitrox or mixed gas as a breathing gas, increased partial pressures of oxygen can increase the likelihood of seizures. Increased carbon dioxide may also increase seizure risk.
The best advice is to get a precise diagnosis of the cause of altered states of consciousness: effective treatment is often available. You cannot make a reasonable fitness-to-dive decision till this is sorted out. It may take some time and a visit to a neurologist or other specialists. Ask your doctor first.
For more information on conditions involving the central nervous system, see all of Dr. Hugh Greer's article from the May/June 1999 issue of Alert Diver.