Witness Sonnet 29.
…I all alone beweep my outcast state…
And look upon myself and curse my fate,
Wishing me like to one more rich in hope,
Featured like him, like him with friends possess'd,
Desiring this man's art and that man's scope…
But the man shows us how to diminish this demon when it appears, as it is bound to do time and again. In simply recognizing he’s comparing, Shakespeare remembers his true self.
I imagine him laughing for a moment about the absurdities of human nature, picking up his quill and getting back to work.