Some nights, you might dismiss your time limit for social media and keep scrolling, or you can’t stop binge-watching your favorite show. Perhaps you took the assignment’s midnight due date too literally — most of us have been there.

When you’re young, all-nighters sound cool and exciting. Losing sleep on purpose felt like another act of rebellion that was too sweet to pass up. However, becoming an adult is realizing that all-nighters are far worse than any nightmare your dreams can come up with while asleep.

What happens when we don't sleep?

In 1963, two boys tested the question for a high school science experiment by seeing what would happen to one of their bodies if they broke the world record for the longest time awake.

Bruce McAllister and Randy Gardner’s experiment soon caught national news attention when the common fear prior to the boys’ famous experiment was that lack of sleep would eventually kill a person.

McAllister told BBC that after the 265 hours — 11 days — were up and the experiment ended in success, Gardner, the one who stayed awake the whole time, slept for 14 hours straight at a hospital where his brain waves were monitored.

McAllister said that Gardner’s results concluded that “his brain had been catnapping the entire time. … parts of it would be asleep, parts of it would be awake.”

Adding that it makes sense in terms of evolution, “He wasn’t the first human being – or pre-human being – to have to stay awake for more than one night and that the human brain might evolve so that it could catnap – parts of it could catnap and restore – while parts of it were awake – made total sense. And that would explain why worse things didn’t happen,” he said, per BBC.

What is the best temperature for sleep? Study answer might surprise you

According to the National Institute of Health, sleep is vital for a person’s overall health and well-being, “Getting inadequate sleep over time can raise your risk for chronic (long-term) health problems. It can also affect how well you think, react, work, learn, and get along with others.” The Institute emphasized that for children and teenagers, sleeping is required for proper growth.

How much sleep do I need?

The amount of sleep a person needs fluctuates as you age.

The Centers for Disease Control and Prevention listed the following recommended hours of sleep per day for different age groups:

  • Newborn: 14-17 hours
  • Toddler: 11-14 hours
  • Elementary school: 9-12 hours
  • Teenager: 8-10 hours
  • Adult: 7 or more hours

“As a society, as families and individuals, we have not yet fully appreciated the importance of sleep,”  Terry Cralle, a certified clinical sleep educator in Fairfax, Virginia, told Everyday Health. “Sleep, along with diet and exercise, constitutes the very foundation of good health.”

How to maintain better sleep

Even if you are sleeping the correct amount of hours, your quality of sleep matters too. Sleep Foundation refers to a person’s quality of sleep as “sleep hygiene” and shares ways on how to improve those precious shut-eye hours.

Investing in good quality bedding that won’t make you uncomfortable, whether your comforter is too heavy or your mattress is too stiff, plays an important role in staying asleep through the night.

The Sleep Foundation also recommends keeping your bedroom dark at night, “Excess light exposure can throw off your sleep and circadian rhythm. Blackout curtains over your windows or a sleep mask over your eyes can block light and prevent it from interfering with your rest. Avoiding bright light can help you transition to bedtime and contribute to your body’s production of melatonin, a hormone that promotes sleep.”

A recent study found that warmer temperatures play an important role in sleeping better. “Especially for those 65 and older, warmer temperatures are better — between 68 and 77 degrees. Below or above that range, sleep quality declines,” Deseret News reported.

Along with these factors and many more, the CDC recommends being consistent with your sleep habits to optimize your sleep and maintain a healthy life.