If you're feeling sleepy and want to wake yourself up — and have 20 minutes or so to spare before you need to be fully alert — there's something you should try. It's more effective than drinking a cup of coffee or taking a quick nap.

It's drinking a cup of coffee and then taking a quick nap. This is called a coffee nap.

It might sound crazy: conventional wisdom is that caffeine interferes with sleep. But if you caffeinate immediately before napping and sleep for 20 minutes or less, you can exploit a quirk in the way both sleep and caffeine affect your brain to maximize alertness. Here's the science behind the idea.

How a coffee nap works

(Claudia Merighi/Getty Images)

To understand a coffee nap, you have to understand how caffeine affects you. After it's absorbed through your small intestine and passes into your bloodstream, it crosses into your brain. There, it fits into receptors that are normally filled by a similarly-shaped molecule, called adenosine.

Adenosine is a byproduct of brain activity, and when it accumulates at high enough levels, it plugs into these receptors and makes you feel tired. But with the caffeine blocking the receptors, it's unable to do so. As Stephen R. Braun writes inBuzz: the Science and Lore of Alcohol and Caffeine, it's like "putting a block of wood under one of the brain’s primary brake pedals."

IT TAKES ABOUT 20 MINUTES FOR CAFFEINE TO HIT YOUR BRAIN

Now, caffeine doesn't block every single adenosine receptor — it competes with adenosine for these spots, filling some, but not others.

So if you nap for those 20 minutes, you'll reduce your levels of adenosine just in time for the caffeine to kick in. The caffeine will have less adenosine to compete with, and will thereby be even more effective in making you alert.

Experiments show coffee naps are better than coffee or naps

Scientists haven't directly observed this going on in the brain after a coffee nap — it's all based on their knowledge of how caffeine, adenosine, and sleep each affect the brain independently.

But they have directly observed the effects of coffee naps, and experiments have shown they're more effective than coffee or naps alone in maximizing alertness.

PEOPLE WHO TOOK A COFFEE NAP COMMITTED FEWER ERRORS IN A DRIVING SIMULATOR

In a few differentstudies, researchers at Loughborough University in the UK found that when tired participants took a 15-minute coffee nap, they went on to commit fewer errors in a driving simulator than when they were given only coffee, or only took a nap (or were given a decaf placebo). This was true even if they had trouble falling asleep, and just laid in bed half-asleep during the 15 minutes.

Meanwhile, a Japanese study found that people who took a caffeine nap before taking a series of memory tests performed significantly better on them compared to people who solely took a nap, or took a nap then washed their faces or had a bright light shone in their eyes. They also subjectively rated themselves as less tired.

Interestingly, there's even some evidence that caffeine naps can help people go for relatively long periods without proper sleep. As part of one study, 24 young men went without proper sleep for a 24-hour period, taking only short naps. 12 of them, who were given just a placebo, performed markedly worse on a series of cognition tests, compared to their baseline scores. 12 others, who had caffeine before their naps, managed scores roughly the same as their baselines for the entire day.

How to take a coffee nap

Taking a coffee nap is pretty straightforward. First, drink coffee. Theoretically, you could drink another caffeinated beverage, but tea and soda have generally have much less caffeine than coffee, and energy drinks are disgusting. Here's a good database of the amount of caffeine in many types of drinks.

You need to drink it quickly, to give yourself a decently long window of time to sleep as it's going through your gastrointestinal tract and entering your bloodstream. If it's tough for you to drink a lot of hot coffee quickly, good options might be iced coffee or espresso.

Right after you're finished, immediately try to go to sleep. Don't worry if it doesn't come easily — just reaching a tranquil half-asleep stage can be helpful.

Finally, make sure to wake up within 20 minutes, so you don't enter the deeper stages of sleep, and you're awake when the caffeine is just starting to hit your brain.