A study published in the journal Appetite reports that what you eat can affect the amount and quality of your sleep.

"In general, we know that those who report between [seven to eight] hours of sleep each night are most likely to experience better overall health and well-being, so we simply asked the question, 'Are there differences in the diet of those who report shorter sleep, longer sleep, or standard sleep patterns?'" study researcher Michael A. Grandner, Ph.D., of the Center for Sleep and Circadian Neurobiology at the university, said in a statement.

Researchers from University of Pennsylvania's Perelman School of Medicine counted the calories of participants in the National Health and Nutrition Examination Survey over a two year between 2007 and 2009.

Scientists found a correlation between the amount of calories consumed and the duration, seeing that they were inversely correlated. Those that ate more calories slept less and vice versa.

The survey found certain trends, such as in those that drank little tap water and have few carbohydrates sleep less.

The researchers made note that there was a correlation in those that slept for a very short amount of time, a short amount and a large amount of time, but not those who slept normal hours, had less variety in their diet.

"This will be an important area to explore going forward as we know that short sleep duration is associated with weight gain and obesity, diabetes, and cardiovascular disease," Grandner added. "Likewise, we know that people who sleep too long also experience negative health consequences. If we can pinpoint the ideal mix of nutrients and calories to promote healthy sleep, the healthcare community has the potential to make a major dent in obesity and other cardiometabolic risk factors."

The study did not show a cause and effect, but rather just a correlation between eating habits and sleeping habits.

But the question still remains, does sleep affect eating habits, or do eating habits affect sleep?

The article published in the journal Appitite can be found here