Its extremely common to experience erectile dysfunction due to anxiety and sometimes without any discernable cause. It would be helpful if you work on reducing overall anxiety and stress, whether it is in personal life or due to work. Time can range from 6-8 weeks but you should not pressurise yourself into a time frame.
Next Steps
Consult a therapist who would help you with reducing stress and anxiety and also teach certain home exercises.
Health Tips
It would not be beneficial if you try and check whether you are getting erection.