The alarm goes off and you're incredibly groggy. Should you hit the snooze button or roll out of bed and go to the gym?

When you pit sleep versus exercise, there's no clear winner. Both are key to good health and experts say there's no way you should sacrifice one at the expense of the other, at least not on a regular basis. Regular exercise helps you sleep well and a good night's sleep helps you reap the benefit of exercise. Add in solid nutrition and you have the trifecta of a healthy, happy life.

But every once in a while, you may have to make a choice between that extra hour of sleep and an hour of exercise. And when you do, you may be happy to hear that most experts grudgingly say you can crawl back under the covers. Hello, pillow!

“When you look at the research, regular physical activity is important for high-quality sleep, and high-quality sleep is important for physical performance,” Cheri Mah, a sleep medicine researcher at Stanford University and the University of California, San Francisco, told Time.

When pressed to choose whether sleep or exercise was more critical, Mah reluctantly chose sleep. “Sleep is foundational,” she says.

Different people have different sleep needs, but most studies say adults need a minimum of seven hours of quality sleep each night.

“Lots of individuals think they can operate on less, but when you test them, you find they’re not performing at their best,” Mah says. “They get used to feeling tired, and they think that’s the norm.”

So if you were up late or just tossing and turning, it may be OK to occasionally choose catching more zzzs over running on the treadmill.

man looking in refrigeratorWhen you're tired, you may tend to overeat. (Photo: Andrey_Popov/Shutterstock)

Plus sleep may be good for your waistline, as well as your overall health, says CNN's Dr. Sanjay Gupta in his videoseries "Living to 100."

"When you don’t sleep enough, you actually start eating more. We're not entirely sure why that happens," Gupta says.

"It appears to be this area of the brain known as the satiation center, that part of the brain that allows you to feel full, is not quite as activated when you're not getting enough sleep. If I could do one thing in a particular day — either get another hour of sleep or do some exercise — sleep would actually probably win."

And sometimes, if you're sleep-deprived and you choose to exercise, your workout could suffer.

"Insufficient sleep degrades performance, focus and concentration," Kathy Gromer, the campus director for the Minnesota Sleep Institute in Burnsville, Minnesota, toldthe Wall Street Journal. "Tired people don't perform as well and get hurt more easily."

Exercise and sleep are good for each other

According to the extensive 2013Sleep in America poll by the National Sleep Foundation, people who exercise are more likely to report that they had a good night's sleep. While 83 percent of people who are vigorous exercisers and 77 percent of moderate exercisers say they get "very good" or "fairly good" overall sleep quality, only 56 percent of the people who never exercise report the same.

A good night's sleep results in better and longer exercise sessions the next day, Dr. Phyllis Zee, a professor of neurology and director of the Sleep Disorders Center at Northwestern University, toldthe New York Times. Conversely, poor quality sleep makes you less motivated to exercise the next day.

“Exercise can improve the quality of sleep,” said Zee, prompting “deep sleep that is more restorative and effective for memory, performance and physical health.”

woman reading before fireplaceIt may help you fall asleep if you have a relaxing bedtime routine like reading before bed each night. (Photo: Africa Studio/Shutterstock)

Be smart about it

Of course in the perfect world, you'll find time for everything. You'll get to bed early enough and get a great night's sleep so you wake up refreshed and feeling great — great enough that you'll find time in your day to exercise.

If you're not sleeping well, make sure you are practicing good sleep hygiene, which means doing all the things you can to get good sleep.

  • Go to bed and wake up at the same time every day.
  • Keep your room cool. (Gupta suggests between 68-72 degrees; the National Sleep Foundation says between 60 and 67 degrees. Experiment and see what works best for you.)
  • Don't eat a big meal close to bedtime.
  • Avoid caffeine late in the day.
  • Keep your room dark and quiet.
  • Turn off electronic devices close to bedtime and keep them out of the bedroom.
  • Get into a relaxing bedtime routine — maybe listening to music, reading or taking a warm bath — before slipping between the sheets.

Mary Jo DiLonardo covers a wide range of topics focused on nature, health, science and anything that helps make the world a better place.

You have an extra hour: Should you sleep or exercise?
We need sleep and we need exercise, but what do you do when one of them has to give?