Do you ever wonder why you can’t stop tossing and turning on a hot summer night? According to a new study published in the journal One Earth, increases in nighttime temperatures have a harmful effect on sleep quality.

Over the span of six months, researchers linked data from accelerometer-based sleep tracking wristbands in over 47,000 people across 68 countries to global weather and climate measurements.

Here’s what they found:

  • On nights where temperatures reached 86 degrees Fahrenheit and above, sleep declined an average of 14 minutes.
  • The probability of getting less than 7 hours of sleep increased by 3.5 percent if outdoor temperatures reached 77 degrees Fahrenheit and above.
  • By the year 2099, people will likely lose between 50 to 58 hours of sleep each year due to rising global temperatures.

“Thermal environment could affect sleep significantly,” said Natalya Thorevska, MD, FCCP, medical director at the Hartford Hospital Sleep Disorder Center. She added that humidity is another important factor that affects sleep. “Heat and high humidity have shown to delay sleep onset and may cause both early and nocturnal awakenings.”

Dr. Thorevska recommends the following for a better night’s sleep:

  • Maintaining cooler room temperatures with a humidity level of 40 to 60 percent.
  • Wearing lighter clothes to bed and using a lighter blanket.
  • Avoiding exercise and other heat generating activities close to bedtime.