My hubby had restless leg syndrome (along with Sleep apnea for whihc he uses a CPAP machine) The restless legs thing begins just as he's falling asleep--either by a rhythmic twitching or bouncing of his legs or a full scale whole body jerking. It's pretty weird. I could set a clock by the pattern, too. Fifteen to twenty seconds between episodes, for the first four or five hours of the night. He takes Mirapex, a drug used for Parkinson's Disease, which helps a ton. It's a very tiny dose but does the trick. Docotrs tend to dismiss this as no big deal but it IS to the person who has to share the bed. My hubby is 6'5" and weighs 280 lbs. Trust me, when he has a full body spasm, I FEEL IT! Good luck to you on this!
There are two conditions that can cause these symptoms--restless leg syndrome (RLS) which makes the legs twitch and periodic limb movement syndrome/disorder (PLMS or PLMD) in which other parts of the body twitch also.
As Buffy indicated, leg twitches can accompany the sleep disorder sleep apnea...a person with apnea stops breathing for periods of time which can result in a significant drop of oxygen in the blood. Sometimes the rls goes away when the person is treated for apnea...but sometimes it doesn't.
I was diagnosed with apnea and with rls/plms and now use a cpap machine to sleep at night...I LOVE IT!!!! But it didn't do diddlysquat for my noturnal movements/jerks. Iron pills didn't help and neither did the Mirapex. However, I stopped jerking within 3 days of disco'ing some rx medication I had been taking.