Though David is, in this psalm, much in prayer, yet he did not neglect the duty of thanksgiving; for those that pray much will have much to give thanks for. See, 1. How much God’s hand was eyed in his thanksgivings. He does not say, “I will give thanks because of thy favours to me, which I have the comfort of,” but, “Because of thy righteous judgments, all the disposals of thy providence in wisdom and equity, which thou hast the glory of.” We must give thanks for the asserting of God’s honour and the accomplishing of his word in all he does in the government of the world. 2. How much David’s heart was set upon his thanksgivings. He would rise at midnight to give thanks to God. Great and good thoughts kept him awake, and refreshed him, instead of sleep; and so zealous was he for the honour of God that when others were in their beds he was upon his knees at his devotions. He did not affect to be seen of men in it, but gave thanks in secret, where our heavenly Father sees. He had praised God in the courts of the Lord’s house, and yet he will do it in his bed-chamber. Public worship will not excuse us from secret worship. When David found his heart affected with God’s judgments, he immediately offered up those affections to God, in actual adorations, not deferring, lest they should cool. Yet observe his reverence; he did not lie still and give thanks, but rose out of his bed, perhaps in the cold and in the dark, to do it the more solemnly. And see what a good husband he was of time; when he could not lie and sleep, he would rise and pray.