Poor sleep in a person's 30s can lead to memory problems later in life.
A new study involving over 500 people in their mid-30s to late 40s found that those with the poorest quality of sleep were more likely to perform badly in memory tests a decade later.
Participants were given wrist trackers to measure how restless they were sleeping over a period of six nights and those with bad quality rest were more than twice as likely to score poorly in the Montreal Cognitive Assessment - a test of thinking skills that asks people to remember a list of words after a delay and do mental maths.
Experts have theorised that those who wake up frequently at night do not clear out harmful proteins in their brains during sleep which has a long-term impact on thinking skills.
Dr. Yeu Leng, who led the study at the University of California, San Francisco, said: "Our findings suggest that it is the quality rather than the quantity of sleep that is particularly important for cognitive health in mid-life.
"If stress from work is waking someone up, or they are snoring a lot and may have sleep apnoea making them restless, these are things they might want to address. They could be linked to poorer thinking skills later in life."