If it’s too hot at night, research has shown that our sleep suffers. People’s body clocks can get thrown off, hurting the quality of slumber. This is why as climate change sends nighttime temperatures soaring, more sleepless nights may follow.

In the latest issue of Science Advances, researcher Nick Obradovich analyzed CDC health survey data from 765,000 Americans and linked it to weather and climate change information. He found that a month of temperatures being one degree Celsius hotter than usual would mean nine million more nights of bad sleep spread across the United States population.

Lost sleep isn’t just a nuisance, there can be serious health effects, including a weakened immune system and great susceptibility to chronic conditions like diabetes, obesity, depression, and heart problems. Not enough sleep makes it harder for the brain to repair itself after a long day, causing problems with memory and attention.

When warmer temperatures could easily add up to more than 100 million extra nights of poor sleep every year, those individual health problems become a much bigger, costlier society-wide challenge. And that’s just if temperatures are one degree hotter on average. Climate projections for 2050 suggest about twice as much sleep would be lost, while the problem would be more than four times as bad by 2099.

This data just looks at the United States, which is both fairly affluent compared with most countries and located in a relatively mild part of the world, so Obradovich notes it’s possible lower-income and more tropical countries would suffer even greater disruptions to their sleep from rising temperatures. In the U.S., the problem does appear to disproportionately affect the most vulnerable, including those who are 65 or older and those who make less than $50,000 a year.

While global warming appears virtually certain to continue for the foreseeable future, not everything else about tomorrow is as clear. The paper notes that how people live and work 30 or 80 years in the future — and, by extension, how they sleep — could be very different from what it is now. But if things do continue as they are now, the nighttime air conditioning bills are going to be astronomical.