Plan b while ovulating

One thing led to another last night and I had unprotected sex. He literally lasted like a minute before he came and he pulled out but I wanted to take a plan b just for safe measures because I’m ovulating. I took the plan b within 24 hours but I’m wondering if ovulating has anything to do with the effect. Does the pill still work even when you are ovulating?