— Cavan Images / Erin Wagnild/Cavan/Getty Images

Bad news for folks in prime sleepless parenting years: A new study has found that for people in their 30’s and 40’s, the quality of sleep between shuteye and the morning alarm might play a more significant role in our cognitive abilities later in life than previously thought.

The study, published in the journal Neurology, found a link between the sleep you get in your 30’s and 40’s and how sharp you are in your 50s and 60s.

University of California San Francisco researchers analyzed sleep data collected from 526 people with an average age of 40. Participants wore a wrist monitor for three nights and then for three more nights one year later. The participants averaged around six hours of sleep each night. The researchers analyzed sleep quality and duration, and participants kept a sleep diary and completed a sleep quality survey, ranking their sleep from zero (worst) to 21 (best). They also took a series of memory and cognition tests.

After a follow-up 11 years later, the team found that those who reported the most disturbed or fragmented sleep in the first round of data collection were more likely to have decreased or poor cognitive function than those who experienced little to no sleep fragmentation. Sleep fragmentation is defined as short sleep interruptions during the night, caused by stress, anxiety, sleep disorders, or poor sleep hygiene. It can lead to extreme fatigue. Sound familiar?

“Given that signs of Alzheimer’s disease start to accumulate in the brain several decades before symptoms begin, understanding the connection between sleep and cognition earlier in life is critical for understanding the role of sleep problems as a risk factor for the disease,” study author Yue Leng, Ph.D., an associate professor of psychiatry at the UCSF Weill Institute for Neurosciences, UCSF, said in a statement. “Our findings indicate that the quality rather than the quantity of sleep matters most for cognitive health in middle age.”

Self-reported sleep quality wasn’t associated with a decline in cognitive function which could come from the fact that many of us do not even realize we’re sleeping poorly. Time spent asleep was also not a factor, though previous studies have found that there is an ideal amount of sleep we should shoot for each night: about seven to eight hours on average. Although you can “catch up” on sleep by napping or sleeping in the next day, being in sleep debt can hurt your heart, one study found.

There are some limitations to the study. For one, the team noted that baseline cognition was not measured at the onset of the research period. And due to the small participant pool, they suggest further study to determine if the results are consistent across demographics.

This new study adds to an existing and broad body of research that explores sleep’s role in cognitive function as we age. Previous study found that even seven hours of high-quality sleep a night can protect against anxiety and depression, improve working memory and emotional intelligence, and help prevent car accidents.

According to SleepFoundation.org, uninterrupted sleep is also crucial to memory. “Multiple studies have identified sleep continuity as important to thinking, memory, and decision-making. While the exact mechanisms underlying sleep’s role in brain health are not fully understood, research points to uninterrupted sleep as promoting memory consolidation.”

For those of us who will never get eight hours a night — even if just temporarily, like in those first years of having a kid — reading even more news that tells you you’re not sleeping well enough or long enough can feel like a slap to the face. Luckily, there are ways to ensure the best quality sleep possible, even when six is the best you can hope for — like using black-out curtains, avoiding screens for an hour before bedtime, and adding white noise, like from your baby’s white noise machine.