Having trouble sleeping? Just 30 minutes of moderate aerobic exercise can help improve sleep quality. 

A researcher at the Johns Hopkins Center for Sleep says it won't take long to see a benefit.

"It’s generally not going to take months or years to see a benefit," Charlene Gamaldo, medical director of the Johns Hopkins Center for Sleep at Howard County General Hospital, said in a post on the center's website. "And patients don’t need to feel like they have to train for the Boston Marathon to become a better sleeper." 

Moderate aerobic exercise increases the amount of slow wave sleep a person can get. Slow wave sleep refers to deep sleep.

TEXAS HOSPITAL SEES 30 INFANT DEATHS IN 15-MONTH PERIOD, WARNS PARENTS OF CO-SLEEPING DANGERS

Woman sleeping

Moderate aerobic exercise increases the amount of slow wave sleep, or deep sleep, a person gets. (Photo Illustration by Ute Grabowsky/Photothek via Getty Images)

Exercise can also help to stabilize mood and decompress the mind, "a cognitive process that is important for naturally transitioning to sleep," she noted.

Gamaldo recommends picking an exercise that's enjoyable. 

She noted that power lifting and active yoga can raise a person's heart rate, helping to create the biological processes in the brain and body that contribute to better quality sleep. 

IRREGULAR SLEEP COULD PUT YOU IN THE DANGER ZONE FOR HEART DISEASE, SAYS STUDY

"We really want to encourage people to exercise. Just be mindful of timing and whether it seems to affect your ability to get optimal sleep quality," Gamaldo said.

She also highlighted that debate remains regarding what time of the day people should exercise. Some people may find that exercising before bedtime keeps them up. 

Aerobic exercise causes the body to release endorphins and raises the core body temperature. 

woman doing yoga health and fitness

Exercise can also help to stabilize mood and decompress the mind. (iStock)

SLEEP DEPRIVATION COULD REDUCE VACCINE ANTIBODIES, NEW STUDY FINDS

The chemicals can create a level of activity in the brain that keeps people awake and elevation in core body temperatures signals the body clock that it's time to be awake. 

Some people should exercise at least one to two hours before going to sleep, giving endorphin levels time to wash out. 

"I encourage people to listen to their bodies to see how well they sleep in response to when they work out," she said.

man in deep sleep

According to the Centers for Disease Control and Prevention, a third of U.S. adults report they usually get less than the recommended amount of sleep. (iStock)

For others, the time of day to exercise doesn't make a difference. 

"Know your body and know yourself," Gamaldo advised. "Doctors definitely want you to exercise, but when you do it is not scripted."

CLICK HERE TO GET THE FOX NEWS APP 

The Centers for Disease Control and Prevention says a third of U.S. adults report they usually get less than the recommended amount of sleep.

Not getting enough sleep is linked with chronic diseases and conditions, including depression, obesity, diabetes and heart disease.

The agency also recommends getting exercise to improve sleep health, as well as avoiding caffeine and alcohol, not eating large meals and removing electronic devices from the bedroom.