Sleep is important in regulating metabolism . Mammalian sleep can be sub-divided into two distinct phases - REM (rapid eye movement) and non-REM (NREM) sleep. In humans and cats, NREM sleep has four stages, where the third and fourth stages are considered slow-wave sleep (SWS). SWS is considered deep sleep, when metabolism is least active. 
Metabolism involves two biochemical processes that occur in living organisms. The first is anabolism , which refers to the build up of molecules. The second is catabolism , the breakdown of molecules. These two processes work to regulate the amount of energy the body uses to maintain itself. During non-REM sleep, metabolic rate and brain temperature are lowered to deal with damages that may have occurred during time of wakefulness. 
Sleep deprivation and Type 2 diabetes
Baseline levels of insulin do not signal muscle and fat cells to absorb glucose. When glucose levels are elevated, the pancreas responds by releasing insulin. Blood sugar will then rapidly drop. This can progress to type 2 diabetes .
Sleep loss can affect the basic metabolic functions of storing carbohydrates and regulating hormones . Reduction of sleep from eight hours to four hours produces changes in glucose tolerance and endocrine function . Researchers from the University of Chicago Medical Center followed 11 healthy young men for 16 consecutive nights. The first 3 nights, the young men slept for the normal 8 hours. The next 6 nights, they slept for 4 hours. The next 7 nights, they spent 12 hours in bed. They all had the same diet. They found that there were changes in glucose metabolism that resemble that of type 2 diabetes patients. When the participants were tested after sleep deprivation, they took 40% longer than normal to regulate blood sugar levels after a high- carbohydrate meal. The secretion of insulin and the body's response to insulin decrease by 30%. Sleep deprivation also alters the productions of hormones , lowering the secretion of thyroid stimulating hormone and increasing blood levels of cortisol . 
It has also been shown that when slow-wave sleep was suppressed for three nights, young healthy subjects were 25% less sensitive to insulin. They needed more insulin to get rid of the same amount of glucose. If the body does not release more insulin to compensate, the blood-glucose levels will increase. This resembles impaired glucose tolerance, which can result in type 2 diabetes. 
Sleep deprivation and appetite control
Sleep plays a vital role in regulating metabolism and appetite . When sleep deprived, the metabolic system will be out of balance, which will ultimately affect the dietary choices people make. Teens who are sleep deprived crave more carbohydrates. Sleep deprivation is a risk factor for obesity among young adults. 
There are two hormones, leptin and ghrelin , that are important in appetite control. Leptin, released by adipose tissue , is a hormone that inhibits appetite and increases energy expenditure. Ghrelin, released from the stomach, is a hormone that increases appetite and reduces energy expenditure. Sleep deprivation can cause a 19% decrease in the level of leptin. Subjects were deprived of sleep for 2 nights (4 hours per night) and got compensation of sleep for the next 2 nights (10 hours per night). Leptin levels decreased by 18% and ghrelin levels increased by 28%. There was an increase in hunger level by 23 which is probably due to the reduction leptin level. Subjects also preferred high carbohydrate foods (sweets, salty food and starchy food). Craving for salty food increased by 45%. Sleep deprivation can cause people to intake food for emotional/psychological need rather than caloric need of the body. 
Chronic sleep deprivation (less than 8 hours of sleep) was associated with increase in body mass index (BMI). In the Wisconsin sleep cohort study of 1024 patients, the shorter sleep durations showed reduced levels of leptin and elevated levels of ghrelin. In a study with 3000 patients, it has been found that men and women who sleep less than 5 hours have elevated body mass index (BMI). In another study that followed about 70.000 women for 16 years, there was a significant increase in body weight in those who slept 5 hours or less compared to those who slept 7–8 hours. 
As sleep time decreased over time from the 1950s to 2000s from about 8.5 hours to 6.5 hours, there has been an increase in the prevalence of obesity from about 10% to about 23%.