When your morning coffee’s kick is wearing off and that afternoon slump starts to hit you, go and take a nap to keep your mind running properly.

The idea of a siesta is nothing new, particularly in hotter countries like Spain, and researchers have long studied the benefits of these post-lunch catnaps. A new study pinpoints the optimal amount of time seniors should nap in the afternoon for the benefit of their mental function: about one hour.

Findings in the Journal of the American Geriatrics Society were based on surveys of almost 3,000 older Chinese people about their napping habits and data of their cognitive function. Those who napped for a moderate amount of time after lunch — most of them for close to 60 minutes — showed “better overall cognition” as compared to both people who didn’t nap and people who napped for periods that were longer than 90 minutes or shorter than 30 minutes. Based on the results, those moderately long naps “may be an important part of optimizing cognition in elderly adults,” the study suggested, and thus decreasing “the risk of functional dependence and poor quality of life.”

Read: Is It Possible To Sleep Too Much?

The Health in Aging Foundation, a nonprofit group founded by the American Geriatrics Society, said in a statement that the difference in mental function between the moderate nappers and all the rest was equivalent to what “a five-year increase in age would be expected to cause” — the latter group’s mental decline was between four and six times greater.

Mental tests in the study included basic math problems as well as exercises in which the seniors were asked to memorize and recall words or copy simple geometric drawings.

For those who may be afraid napping during the day will prevent them from sleeping at night, the study also found that people who napped the longest after lunch also slept the longest at night, while people who did not nap at all reported the shortest nighttime sleep durations. However, that does not mean napping habits affect nighttime sleep or vice versa — while not offering definitive explanations, the study suggests a person’s ability to nap reflects how well they sleep at night due to a number of factors like genetics or general sleep efficiency.

Afternoon naps were studied specifically because, in addition to an optimal napping time, researchers suspected that “circadian timing” plays a role in the benefits of napping, referring to the body’s internal clock that regulates various habits like sleeping and eating. “Napping during the post-lunch dip period may lead to better cognitive function because post-lunch dip napping has greater recuperative value than napping at other times of the day.”

Although the researchers focused on people 65 and older in their napping study, because of the necessity of maintaining memory and thinking function into old age, it’s possible the cognitive benefits of napping are similar in other age brackets. Young children already nap, and experts have often suggested the rest for other age groups, like college students, although the most beneficial sleep duration may differ from the elderly group.

Source: Li J, Cacchione PZ, Hodgson N, et al. Afternoon Napping and Cognition in Chinese Older Adults: Findings from the China Health and Retirement Longitudinal Study Baseline Assessment. Journal of the American Geriatrics Society. 2016.

See also:

Weird Things Your Body Does In Your Sleep

Hacks to Sleep Through Snoring