Uti sex

So I just found out today that I have a uti but it is very mild because it is just starting so can I have sex tomorrow and then directly after start taking the medication? I’m just wondering if it’s gonna hurt or last longer if I do it this way