Most people drink coffee first thing in the morning. But is that the right way to do it? If you’ve ever had coffee and felt like it didn’t work, you’ve run into the field of chronopharmacology—the study of how medications and drugs interact with your biology.

When it comes to coffee, the main piece of biology to consider is your body’s level of cortisol—a hormone related to stress and alertness. The more cortisol in your body, the more naturally alert you are, explains Steven Miller at NeuroscienceDC. The more alert you are, the less effective coffee is going to be. So you should really time your caffeine doses with your dips in cortisol, Miller says:

Although your cortisol levels peak between 8 and 9 AM, there are a few other times where–on average–blood levels peak again and are between noon to 1 PM, and between 5:30 to 6:30 PM. In the morning then, your coffee will probably be the most effective if you enjoy it between 9:30 AM and 11:30 AM, when your cortisol levels are dropping before the next spike.

According to the National Health Service in the United Kingdom, the precise optimal time to drink coffee is at 2:16pm. They didn’t base this on cortisol measurements, but rather a survey of when workers feel the most tired. And if you really want to get the most out of your maximally optimal coffee experience, LifeHacker suggests taking a 15 minute (no longer) nap right after you chug your coffee—a strategy known as the “caffeine nap.”

More from Smithsonian.com:

The History of Coffee Culture in America

From Elephant Poop Coffee Comes Elephant Poop Coffee Beer