Pregnancy test

I took one about a month ago and I think I took it too soon to tell if i was pregnant. So when is it the ideal time to take one?