Magnesium as a laxative can be taken to help relieve constipation. Depending on the individual, it can work quickly, taking between 30 minutes-3 hours to take effect.