I take the dosage recommended by my functional medicine doctor just before bedtime. It seems to help me unwind and fall asleep. Taking magnesium and eating dark leafy greens daily seems to help me avoid waking up at night with painful muscles spasms in my legs.