Use a dynamic timeout to wait for the optimal time.