It is not so much when you exercise that affects sleep but perhaps how consistent you are with your wake time and your sleep time as well as with what you eat and when, an expert says. (Getty Images/iStockphoto)

Although elite athletes and experienced runners compete in the Marine Corps Marathon, it’s widely recognized that the race is beginner- and family-friendly. That means there’ll be first-timers at the start on Oct. 22, and second-timers.

Like me.

As I consider a typical beginner 20-week marathon training plan, it’s hard not to notice how much my weekly mileage will increase throughout the summer months, which in Washington can be brutal.

On top of that, the schedule includes three runs during the week, up to seven miles each. If you’re a back-of-the-pack runner, that means you’d need to allow up to 80 minutes of running and between 30 minutes to an hour of warming up and stretching before and after to prevent injury.

I’m not a math whiz, but adding the extra mileage before work can seem impractical.

Even if you don’t have a 9-to-5 job, running outside in the middle of a summer day in Washington could be dangerous, according to Adam Friedman, associate professor of dermatology at George Washington University. In addition to the acute risks of sunburn and heat rash and the long-term cancer risks of sun exposure, Friedman said, exercising in a sunny, hot environment can cause fluid shifts in your skin as you sweat, stretching and damaging your skin and increasing the likelihood of wrinkles and fine lines.

I was thinking — okay, obsessing — about this, as I was walking to the Metro about 11 on a recent weeknight when I noticed a handful of runners who looked like they were coming from the Mall.

Running at night? Could I do that?

Wouldn’t exercising at night keep me awake?

I know there are plenty of people of all ages who work out in the early evenings after work or school, because I see them running in my neighborhood or at the gym. And I’ve done this myself on occasion. In fact, according to Amanda Kim, a spokeswoman for Under Armour, the majority of runs logged in the United States in 2016 on one of the Under Armour apps were at 5 p.m. in the winter and 6 p.m. in the summer months.

Yet as my marathon training approached, I wondered what impact shifting to evening and possibly night workouts, lasting up to three hours, might have on my sleep.

“Most people used to think it was too energizing to exercise in the evening,” said Charles A. Czeisler, director of the division of sleep medicine at Harvard Medical School.

But Czeisler, whose medical practice includes providing sleep consultations to professional athletes and sports teams, said he’s not aware of any evidence that supports an adverse impact from evening exercise.

Particularly for people who are training, no matter what time of day, exercise actually helps to increase the depth, or quality, of sleep, he said.

“Exercise in the evening does not disturb sleep and can even promote sleep a little bit,” said exercise science specialist Shawn Youngstedt, professor of nursing and innovation at Arizona State University, who’s in the third year of a four-year study of veterans with sleep apnea. “Exercise ending even a half-hour before bedtime does not disturb sleep for most subjects.”

It’s not so much when you exercise that affects sleep but perhaps how consistent you are with your wake time and your sleep time as well as with what you eat and when, Czeisler said.

The idea is to try to keep the interval between your first meal and your last meal of the day on the order of 12 hours or less, according to Czeisler. That means if you’re having breakfast at 8 a.m. you don’t want to eat dinner after 8 p.m. In addition, eating a meal after your body begins to release the hormone melatonin, which happens after the sun sets and helps to maintain glucose levels during the night, he said, can interfere with your circadian rhythm, which ultimately has the greatest impact on your sleep.

And that’s where evening workouts can be tricky. To train optimally, a person who eats breakfast at 8 a.m. would need to finish running (and stretching) at least by 7:30 p.m. to finish eating at 8 p.m., with maybe a half-hour left before sunset. Seem unrealistic?

Maybe. I decided to try a seven-mile run after work, but before I left I checked what time the sun would be setting. It turned out sunset was about 8:30. So I ate breakfast later than usual that day, went to work and then ran, getting in just six miles before stopping at 8 p.m. I did a few quick stretches and ate some chicken and brown rice leftovers with roasted vegetables. I was in bed by 9:30.

I realize on some days it might not be possible to do everything right. I asked Youngstedt about this.

“People should exercise when it is convenient,” he said, “when they can consistently do it.”

“The three pillars of good health are nutrition, exercise and sleep,” Czeisler said. “But they shouldn’t be at odds with each other. Exercising at 4 o’clock in the morning and therefore not sleeping or getting up at 5 and losing two hours of sleep in order to exercise is a bad idea, just as eating in the middle of the night is a bad idea.”

In addition, long-distance running can increase your sleep needs, which can average between seven and nine hours, depending on your age, Czeisler said. But just as you do when you travel across time zones, you can adapt your biological clock to your training. This is especially important to keep in mind about a week before your race so that you can adjust your rhythm to accommodate the race start time, he added.

Don’t know how much sleep is right for you? The National Sleep Foundation has guidelines at .

Recovery eating that won’t keep you awake

According to Philadelphia sports dietetics specialist Kelly Jones, if you’re planning to exercise in the evening, it’s important to eat throughout the day to fuel your workout and to prevent overeating afterward. Yet don’t be tempted to exercise and then go to sleep without eating, Jones said.

“The same fueling and recovery principles apply, no matter what time of day you are moving your body.”

Jones recommends a balanced breakfast and a mid-morning snack, which would allow you to eat lunch later in the afternoon. You want lunch to be a slightly bigger meal than usual, she said, while staying away from fried foods and excessive saturated fats. This way, a snack two hours prior to exercise can help you to fuel your workout and prevent excessive hunger.

After exercise, you want to consume a combination of carbohydrates and protein within an hour, she said. This may require some planning and preparation, but in a pinch, Jones said, you can grab a cup of yogurt to mix with whole-grain cereal and fruit. Tart cherries added to yogurt and smoothies are great for muscle recovery and have potential sleep benefits, Jones noted.

Specific foods to avoid at night include anything with excessive sugar or any caffeine, Jones said.

It’s important to eat even if you’re going to sleep not only because you just exercised, but also because the growth hormone that is released after you fall asleep (which aids in muscle recovery) depends on protein and carbohydrates, Jones said.

She added that if you’re exercising for longer than an hour, even in the evening, you should consider fueling during the workout. Many popular sports gels and energy drinks contain caffeine, however, so check the label before consuming, she said. Czeisler noted that caffeine can stay in your system for up to nine hours. This means you could still experience the effects of about half the amount of caffeine from the cappuccino you drank at lunchtime as late as 9 p.m.