Hi
Welcome to the MedHelp forum!
Dehydration and electrolyte imbalance, muscle fatigue, pinched nerve due to wrong posture could be the cause. Change your posture and drink some fluids and see. Other than this it can be deep vein thrombosis.
If the twitch persists, I would suggest you get the blood levels of the following checked if they have not already been checked: potassium, calcium, sodium, magnesium, vitamin B complex, or vitamins B1, B3, or B6 and Vitamin D. Generally deficiencies of any of the above can cause muscle twitching and spasms in localized or generalized areas of the body. Get your kidney function, parathyroid gland function and adrenal function tests done because these affect the electrolyte balance in the body. Stress, alcohol, caffeine and fatigue all cause similar symptoms. Hence if you take alcohol or coffee then cut this down. Sleep at regular hours and see if it helps. Certain sleep disorders and peripheral nerve disorders due to diabetes or hypothyroidism can also be the cause.
Since I cannot examine you and know other related conditions you may be having, nor is a detailed history possible on net, I have listed the various possibilities that should be looked into. Please consult your PCP for primary examination followed by proper referral. Take care!
It is most likely your muscle having what it called a spasm. There are also links with having enough vitamin d in your diet. I have them and I take a medication for a nerve issue. It seems to be linked to my fibromyalgia. I would look up restless legs syndrome. I do not think it is harmful, just obnoxious. I have them all over my body at times...sometimes they are sore after it goes on for a while. I also make sure I get enough potassium.