Irregular period and pregnancy test.

I have a irregular period. How long after sex should I test?