It’s your first waking thought in the morning—Come to me, baby! Soon you’re rolling over and reaching for your longtime love, that warm and fragrant cup of coffee. You know that you can count on its trusty shot of caffeine to rev you up and get you started on your busy day. Except: The early hours of the morning generally are not the best time of day for a caffeine boost—which means that many people are drinking their coffee all wrong.

It’s a question of chronopharmacology, or how drugs (including caffeine) interact with our natural biologic rhythms, I heard from internist and endocrinologist Joseph J. Pinzone, MD, CEO and medical director of Amai Medical & Wellness in Santa Monica and assistant clinical professor of medicine at the David Geffen School of Medicine at the University of California, Los Angeles. Here’s what Dr. Pinzone thinks you really ought to be doing and why—but don’t worry, you don’t have to give up your beloved joe…

THE CORTISOL/CAFFEINE CONNECTION

A primary effect of caffeine is to trigger the release of the hormone cortisol, which is related to a number of functions, including alertness and the stress response. The more cortisol that’s circulating in your system, the more energized and awake you feel. But: Cortisol levels naturally rise first thing in the morning (typically between 6 am and 8 am, depending on an individual’s sleep/wake cycle). “Your body doesn’t really need the caffeine at that point because cortisol levels are already rising as you’re waking up,” said Dr. Pinzone.

Then why do so many people crave coffee before their feet even hit the floor? It’s more a matter of habit than chronobiology. People think that the coffee is revving them up because its first-thing-in-the-morning consumption happens to coincide with the body’s natural cortisol surge. But biochemically, the caffeine is redundant at that point—and what’s more, by consuming caffeine when it’s not really needed, your body builds up tolerance to it, diminishing its ability to provide that longed-for energy jolt.

Cortisol levels do not remain consistent throughout the day. After the early-morning rise, cortisol dips in midmorning…peaks again around midday…falls again…rises once more between 4 pm and 6 pm…and then ebbs before bedtime.

What this means, coffee-wise…

For maximum energy-boosting impact, delay your first cup of java until the midmorning cortisol slump starts to sap your stamina, typically at around 10 am, Dr. Pinzone suggested.

Then, instead of having another cup with lunch, wait until your midafternoon energy dip, which for many people occurs at around 2 pm. A cup of coffee then could help you power through the rest of your workday.

As for the evening drop in cortisol, you probably are best off just letting it happen. After all, it’s helping your body prepare for sleep, and caffeine at that point could interfere with your slumber. But go ahead and experiment if you want to, Dr. Pinzone said—if you enjoy an evening burst of energy and are still able to sleep just fine, a dinnertime cup (or half-cup) of coffee could be OK for you.

Lots more great reasons to drink coffee: A well-timed energy boost is not the only advantage of drinking coffee. To learn about the beverage’s many other benefits, read “How Coffee Makes You Happier and Healthier.”