While Joseph Smith was imprisoned in Liberty Jail, he pleaded to the Lord regarding what seemed to him as abandonment considering the trials the early Saints were going through (see D&C 121).
The Lord responded in D&C 122. In verse 9, he said the following:
Some people may find a statement like this to be comforting. What I wonder though is how you know if the number of days are up.
If you are standing at gunpoint for example, how do you know whether God is going to intervene to save you or whether this is when you are supposed to die?