“I have reflected over an interesting situation: that a calamity may befall a believer and so he supplicates, going to great lengths in doing so, but he sees no sign of an answer. So when despair comes close, at that time his heart is looked at, thus if it is accepts the [many] decrees of fate, not having despaired of Allah, the Mighty and Majestic’s Bounty, then in most cases at that time the response is hastened, for it is there that eemaan is qualified, and the devil vanquished, and it is there that a man’s worth is shown.
And this has been alluded to in His Saying, the Most High, “… until [even their] messenger and those who believed with him said, “When is the help of Allah?” [Baqarah 2:214].
And likewise is what happened to Ya’qoob عليه السلام, for when he lost a son and the situation went on for a long time, he did not despair–and then his other son was taken, but his hope in his Lord’s Bounty that, “… perhaps Allah will bring them to me all together …” [Yusuf 12:83] still did not cut off.
And likewise Zakariya عليه السلام said, “… and never have I been in my supplication to You, my Lord, unhappy [i.e., disappointed].” [Maryam 19:3]
So beware of considering as too long the time for a prayer to be answered!
And look to the fact that He is the Sovereign Lord/the Absolute King of the entire universe, and that He is the All-Wise in that which He plans, and the One who knows what is of benefit [to you], and that He wants to examine you in order to test your concealed mettle, and that He wants to see your earnest supplication, and that He wants to reward you for your patience, and other such purposes.
In addition to that, He is testing you by delaying the response to your supplication so that you can fight Iblis’ whisperings and wicked insinuations–and every one of these things strengthens [one’s] belief in His Bounty, and obligates being thankful to Him–for He, by testing you with the trial, prepared you to turn to ask Him.
And the distressed person’s destitution/poverty in having to turn to Him is total and utter affluence.”
Saydul-Khatir, pp. 227-228.