Did I take the test too soon?

Hi everyone! I just took a test and it says I am not pregnant. My period was due April 2nd, but it’s always pretty irregular. April 4th, I had sex. after my period was 22 days late, I started getting nervous. I tested after my period was late, but also had sex after my period due. It’s been 20 days after sex, is this enough time to produce an accurate result? Thanks!