From the days of newspaper TV Guides that would write two sentence synopses (loglines) of a television show. Sometimes these summaries wouldn't sound comedic on the surface, so "hilarity ensues" was used to ensure the audience understood it was a premise for a comedy.
Tonight on Seinfeld, George decides the best time to have a snack is during sex. Hilarity ensues.
November 10, 2010