Friedrich Nietzsche said this quote

The solitary speaks.One receives as a reward for much ennui , ill-humour and boredom, such as a solitude without friends, books, duties or passions must entail, one harvests those quarters of an hour of the deepest immersion in oneself and nature. He who completely entrenches himself against boredom also entrenches himself against himself: he will never get to drink the most potent refreshing draught from the deepest well of his own being.