Avoiding cistitus

Im

I know that you need to pee after sex but does it have to be straight after or can there be a delay?