Gustave Flaubert said this quote

At last she sighed.But the most wretched thing — is it not? — is to drag out, as I do, a useless existence. If our pains were only of some use to someone, we should find consolation in the thought of the sacrifice.