If you find yourself losing consciousness for a few minutes from time to time, you may be lacking glucides. Depriving yourself of complex (slow assimilation) and simple (rapid assimilation) sugars because you want to lose weight can be very harmful.
Glucides provide the body with the energy. Not eating enough can leave you feeling chronically tired, exhausted after the slightest effort, and much more vulnerable to all types of bacterial or viral infections.
Your organism, forced to use up its reserves of fat to synthesize its own glucides, is under a constant strain. Your liver and kidneys are especially effected, and can be weakened or damaged. This, in turn, can cause cerebral fatigue and loss of consciousness.
Making sure to eat reasonable amounts of complex and simple sugars should solve the problem.