Ibuprofen

I'm having waves of pretty bad stomach cramps/period cramps. I was wondering if ibuprofen worked for that, in about to go to sleep and that's the only pain medication I have in the house. Will it work? Thanks ^^