Quality sleep in young and middle-aged people helps memory and learning, but as they reach their 70s, 80s and 90s - and generally don't sleep as much or as well - sleep is not associated so much to memory, according to a recent study from Baylor University.

"If sleep benefits memory and thinking in young adults but is changed in quantity and quality with age, then the question is whether improving sleep might delay -- or reverse -- age-related changes in memory and thinking," Michael Scullin, assistant professor of psychology and neuroscience in Baylor's College of Arts & Sciences.

According to Scullin, it's the difference between investing up front rather than trying to compensate later.

"We came across studies that showed that sleeping well in middle age predicted better mental functioning 28 years later," Scullin explained.

The benefits of a sound night's sleep for young adults are diverse and unmistakable. One example is that a particular kind of "deep sleep" called "slow-(brain)-wave-sleep" helps memory by taking pieces of a day's experiences, replaying them and strengthening them for better recollection.

By the time people reach middle age, more sleep during the day, such as an afternoon nap, also helps people's memory and protects against its decline -- as long they don't skimp on nighttime sleep.

But as they grow older, people wake up more at night and have less deep sleep and dream sleep -- both of which are important for overall brain functioning, Scullin said.

Researchers' extensive review began with studies as long ago as 1967, including more than approximately 200 studies measuring sleep and mental functioning. Participants ages 18 to 29 were categorized as young; ages 30 to 60 as middle-aged; and older than 60 as old.

Participants involved in those studies were asked how many hours they typically slept, how long it takes them to go to sleep, how often they wake in the middle of the night and how sleepy they feel during the day. The research also correlated results from numerous brain-wave studies and experiments dealing with sleep deprivation, napping and sleep intervention, such as sleep medications.

Scullin noted that if a person lives 85 years, he or she may sleep nearly 250,000 hours -- more than 10,000 full days.

"People sometimes disparage sleep as 'lost' time," he said. But even if the link between sleep and memory lessens with age, "sleeping well still is linked to better mental health, improved cardiovascular health and fewer, less severe disorders and diseases of many kinds."

The finding are detailed in the journal Perspectives on Psychological Science.