"And my soul is greatly troubled (and you incline your ear), and you, Lord, until when? And you, Lord, who promised me (Psalms 31:15), I am with him in distress. And what does 'until when' mean? Rav Kahana said, it is similar to a patient who was being treated by a doctor, and the patient was waiting for the doctor to come in four hours, or five hours, or eight hours, and he is feeling the heat of the sun, and he comes. The patient said to him, if you had delayed a little longer, my soul would have departed. Similarly, David said, 'And my soul is greatly troubled, and you, Lord, who are the doctor, I yearn for you to come to me.'"
David Cries Out 'Until When' in His Deepest Despair
Midrash Tehillim 6:4