Are you talking about restless legs syndrome? I have this and it is worse at bedtime and when falling asleep. Maddening really. One summer, I had it even in the middle of the day at work. In retrospect, I was mountain biking a lot and not replenishing electrolytes, and the weather was very hot and humid for weeks. I’ve also found a link with low ferritin. My ferritin was 11 and I was prescribed ferrous fumarate. I take it a couple times a week and I still have trouble with RLS from time to time (like right now!). I’ve also tried magnesium supplements (and vitamin B complex). Nothing totally conclusive for me. It just comes and goes.