If you find yourself raiding the pantry before bed, you may want to reconsider — a new study suggests that eating late at night may reduce your life span.

The study published in the journal Science split mice into groups and observed the effect of diet and the timing of meals on life expectancy. Scientists discovered that mice on a calorie-restricted diet who ate only during their active phase increased their life expectancy by 35% compared to the control group who ate whenever and whatever they wanted.

The study also found that mice on a calorie-restricted diet with no restrictions on when they could eat increased their life expectancy by 10%, and those who only ate during their inactive phase increased their expectancy by 20%. But overall, the group that ate only during the active phase yielded the greatest results in increasing life expectancy than any other group.

Previous studies have shown the effects of reducing calories on diet in mice. Now, this study shows how meals impact the circadian rhythm and life span. While scientists only observed male mice, they hope that with further study, their observations could apply to humans.

“We have discovered a new facet to caloric restriction that dramatically extends life span in our lab animals,” senior author Dr. Joseph Takahashi told Medical News Today.

“If these findings hold true in people, we might want to rethink whether we really want that midnight snack.”

Eating later in the evening has other consequences as well.

According to Healthline, consequences can include acid reflux and negative impacts on blood sugar and blood pressure. Additionally, eating later may cause you to make poorer food choices such as overeating or choosing unhealthy snacks that are easy to prepare. The Centers for Disease Control and Prevention recommends eating at least two hours before bed, otherwise, you may experience disruptions to your sleep.

To get specialized news and articles about aging in place, health information and more, sign up for our Aging in Atlanta newsletter.