Question about plan B effectiveness?

My SO and I had unprotected sex recently. What happened was I was inside for maybe a minimum of 4-5 seconds (4 pumps) after realizing that this was an extremely stupid decision and I pulled out. I did not ejaculate and I did not notice any signs of pre-cum. I was scared and thought it was necessary to get my SO plan B one step. It had only been 40min or so since we did the deed. I just want to know if we are safe and shouldn't be expecting a child.. I'm very stressed right now and I hope I didn't screw up the life of my SO and myself.