Coffee, don't fail us now!
Credit: Getty Images

If you're a coffee person (and even if you're not), chances are you reach for a cup of joe when the going gets tough—as in you slept horribly or scored very little shut eye while trying to cram 28 hours into the day. That Starbucks run is what gives you life...but its magic may actually only go so far.

According to a study from researchers at the Walter Reed Army Institute of Research, coffee consumption will give you a lift during two days of poor sleep, but by the third day it might have lost its effectiveness.

"We were particularly surprised that the performance advantage conferred by two daily 200 mg doses of caffeine was lost after three nights of sleep restriction," said lead author Tracy Jill Doty, PhD. in a statement. "These results are important, because caffeine is a stimulant widely used to counteract performance decline following periods of restricted sleep. The data from this study suggests that the same effective daily dose of caffeine is not sufficient to prevent performance decline over multiple days of restricted sleep."

Before you start giving your Nespresso machine the side eye, consider this: The study only sampled coffee's effect on 48 people, so definitely not a lot. They were restricted to just five hours of sleep a night for five days, then their cognitive function was tested, as well as their sleepiness and moodiness rated. While 48 people may seem like a decent number, it isn't all that sizeable in comparison to other scientific studies.

Still, make sure you get your sleep. There's a host of reasons why it's imperative to your health, so we can at least walk away from this study with that little fact. Continue to enjoy your coffee, but remember nothing can take the place of some zzz's. Not even a dirty chai latte.