Whether you've woken up in the middle of the night and treated yourself to a midnight snack, or decided to have a pizza on the way home from a night on the town, eating late at night can potentially cause havoc with your brain. Research has found that eating when we should be sleeping can push our circadian rhythms out of sync and lead to a lower quality of sleep overall.

Those conclusions are based on a study of lab mice by scientists from the University of California. Mice are nocturnal, so sleep during the day: when one group was encouraged to eat during the day for two weeks, they had more frequent and shorter bouts of sleep than the group that was eating normally. The mice were all getting the same amount of sleep, but those whose routines had been disrupted weren't enjoying the same benefits.

The research team found that the mice that were snacking when their bodies wanted to sleep performed worse on memory tests. They also had lower levels of a particular protein called CREB, known to be important in the way the brain learns and forms memories.

Could the same theory apply to humans? It's too early to say, although the researchers think it's a distinct possibility. Our bodies are tuned to work on a 24-hour cycle and anything that takes us out of that routine - such as late night snacking - can be disruptive.

"We do not know yet if this equally applies to humans but shift work has been associated with decreased performance on cognitive tests," reads the report, published in the journal eLIFE. "The misaligned feeding treatment did not result in an overall decrease in amount of sleep, but instead had a severe impact on the temporal pattern, suggesting that this treatment acts via disruption of the circadian timing of sleep."

The problem might not just be exclusive to snacking at night, either. Irregular mealtimes brought on by the hectic and always-on nature of modern life in the developed world could also be causing damage to the organs inside our bodies, each of which runs in sync with the cycles of day and night. However, a lot more research will be required before we'll know if a return to fixed mealtimes is for our own good.

What almost everyone seems to agree on is that sleep is essential to our general well-being and we should make sure we're getting enough of it. If you're struggling to nod off at night time (whether you're tempted by a trip to the fridge or not), check out our list of important habits to get a better night's sleep.