Based on what you write, you most likely performed your
hefsek taharah right at
shekiah. You may count it as being on time.
In the future, you may wish to set an alarm of some sort to help remember to perform the
hefsek taharah earlier. You can also make a
bedikah the morning of a planned
hefsek taharah, to serve as a back up in case there is a mix up later.
Please write back with any further questions.