6 We are merely moving shadows, and all our busy rushing ends in nothing. We heap up wealth, not knowing who will spend it.7 And so, Lord, where do I put my hope? My only hope is in you.8 Rescue me from my rebellion. Do not let fools mock me.9 I am silent before you; I won’t say a word, for my punishment is from you.10 But please stop striking me! I am exhausted by the blows from your hand.11 When you discipline us for our sins, you consume like a moth what is precious to us. Each of us is but a breath. Interlude
12 Hear my prayer, O LORD! Listen to my cries for help! Don’t ignore my tears. For I am your guest— a traveler passing through, as my ancestors were before me.13 Leave me alone so I can smile again before I am gone and exist no more.
As mentioned in verse 10, David much like Job, David believes that God is punishing him and that he will soon die because of it.
Job 7:20 NIV If I have sinned, what have I done to you, you who see everything we do? Why have you made me your target? Have I become a burden to you?
He’s tempted to complain but he doesn't because the ungodly are around but he's not happy about it.
He the prays that God will remind him of how frail he is and that all he is able to accomplish is really nothing when everything is considered. This is much like thoughts of Solomon in Ecclesiastes.
Ecclesiastes 1:2 NIV “Meaningless! Meaningless!” says the Teacher. “Utterly meaningless! Everything is meaningless.”
Ecclesiastes 5:11 NIV As goods increase, so do those who consume them. And what benefit are they to the owners except to feast their eyes on them?
Ecclesiastes 6:2 NIV God gives some people wealth, possessions and honor, so that they lack nothing their hearts desire, but God does not grant them the ability to enjoy them, and strangers enjoy them instead. This is meaningless, a grievous evil.
Ecclesiastes 12:13 NIV Now all has been heard; here is the conclusion of the matter: Fear God and keep his commandments, for this is the duty of all mankind.
He gives vent to his feelings and thoughts concerning the vanity of human aims. He hopes to be led back to a quiet confidence in God which will dispel these vain thoughts.
He then confesses and asks that God will end His punishment so that he can enjoy the balance of his days. David finishes with a prayer: let me live a little longer.