You have to enjoy humorous writing while you're doing it. Anybody who says he doesn't is lying (he may, of course, not like to start). You've got to be enjoying it. You can't be mad, or bitter, or irate. If you are it will be no good . . .
-from Collecting Himself: James Thurber on Writing and Writers, Humor and Himself, edited by Michael J. Rosen.
This is true for me and I know that I'm writing something good when I laugh out loud in the split second when the thought occurs but before I have time to write it down.