If you are having menstrual cramps taking ibuprofen will usually take effect in 30 minutes, and if you are taking extended-release capsules of ibuprofen, the effect will last for 12 hours. But try not to take medicine when you have dysmenorrhea, you can go through some other methods, such as going to the supermarket and buying bags of brown sugar, which you can use to start brewing and drinking during your menstrual period until the end of your menstrual cycle. If you have dysmenorrhea, try to go to the hospital for a checkup to see what causes it and treat the symptoms. Usually, you should do physical exercise to strengthen your body, pay attention to a regular life, combine work and rest, pay attention to keeping warm, pay attention to rest, avoid strain and stay up late. In terms of diet should be light, to prohibit spicy and stimulating diet, usually also pay attention to not eat cold food.