What's the healthiest way to pull an all-nighter?

The occasional all-nighter is a necessary evil for many professionals and students trying to meet a tight deadline. Are there any strategies to make that all-night session and recovery easier? One expert, Eric Olson, co-director of the Mayo Clinic's Center for Sleep Medicine in Rochester, Minn., weighs in on the most effective ways to stay alert until dawn, and why Monday nights are best.

Never say never

The party line from the sleep community is that it is never a good idea to pull an all-nighter, Dr. Olson says. "But it does occasionally need to be done." Ideally, an all-night session should come after a restful period—on a Monday, for instance, after a weekend of rest. Of course, the reason most people pull late nights is because they already lead overtaxed, busy lives.

Strategic dining

Caffeine, most readily in the form of coffee, can give sleep-deprived night owls a much-needed boost. But don't hit the java too soon. "Most people will start to feel pressure to sleep between midnight and 7 a.m., when their circadian rhythm is telling them to shut down," Dr. Olson says. "Caffeine may help you get through that and through the subsequent day."

Time-crunched workers also tend to grab unhealthy snacks. But high sugar intake, which can be followed by a sugar crash, isn't a great strategy. Dr. Olson cites a 2004 University of Chicago study in which healthy young people forcibly restricted their sleep. "The researchers could clearly show that cravings tend to be more carb-based late at night, when the hormone ghrelin, which affects your appetite, goes up and leptin, a hormone of satiety, shuts off," he says. Dr. Olson recommends keeping some protein bars lying around instead of candy to boost energy and wakefulness.

Click for more from The Wall Street Journal.