Like to shake your legs is a subconscious performance. This is not a disease and needs no treatment. Habitual tremor of lower limbs is beneficial to human health. The reason is that this action can promote the blood circulation of lower limbs and maintain and enhance the vitality of muscle joints. The shaking action can not only stretch muscles, but also promote the blood return of lower limbs and prevent the formation of thrombosis and varicose veins in limbs. This habitual action is not an instruction from the central nervous system of the cerebral cortex, so it cannot interfere with or affect the activities it was engaged in at that time. When people are sleepy, lower limb jitter can also offset some fatigue.
People who shake their legs are mostly subconscious, so it may also be a way to relieve anxiety. Just like some people's internal behaviors, most people who shake their legs are extroverted and their anxiety is externalized.