In 2015, a record heat wave roasted Southern California. At the time, Nick Obradovich was a graduate student at the University of California at San Diego. During the day, he said, everyone on campus turned sluggish and grumpy.

Sundown brought little relief. “For a number of nights in the heat wave, I was lying in bed with lots of time to think,” Obradovich said, now a fellow at the Harvard Kennedy School and a research scientist at Massachusetts Institute of Technology's Media Lab. He wondered if anyone had studied the relationship between sleep and temperature anomalies.

Scientists have observed poor rest in hot laboratory environments and sweltering houses. But as far as Obradovich could tell, he told The Washington Post, no one had tracked a large number of sleepers in their homes across the United States. Obradovich decided to investigate. As he and his colleagues noted in a Science Advances study published Friday, the researchers relied on a Centers for Disease Control and Prevention survey representing 765,000 Americans, contacted between 2002 to 2011, from across the United States.

The CDC randomly dials Americans to inquire about where they live, their income, age, how much they drink, if they wear seat belts, if they were sunburned recently and other public health questions. Questioners also ask how many nights of insufficient sleep a person had in the past month. The study authors meshed these responses with weather station records to determine if respondents may have been exposed to unusual nighttime temperatures.

Equipped with this information, the researchers calculated that every nocturnal temperature increase of 1 degree Celsius produced an additional three nights of restless sleep per 100 people per month. Scaled across the United States, the authors wrote that this 1 degree bump translated to about "110 million extra nights of insufficient sleep” each year.

“It is an interesting and important study, which shows the relationship between warm temperatures and sleep quality, and the expected impact of climate change on this,” said Joris van Loenhout, an environmental health expert at the Catholic University of Louvain in Belgium, who was not involved with this report.

Physiologically speaking, this loss of sleep makes sense. Bodies cool down while we prepare to nod off. Our blood vessels expand, allowing heat to escape our bodies quicker. Body temperatures, which fluctuate by about 1 degree over the course of 24 hours, will bottom out in the wee hours of the morning.

“Decreasing body temperature is one of the strongest signals to our brain to bring on sleep onset,” Sara C. Mednick, a sleep psychologist at the University of California at Riverside and co-author of the study, said in an email. “This decrease in temperature is regulated in part by the ambient temperature,” she said. “Thus, when the ambient temperature is too high, the body cannot cool itself and therefore can't fall asleep.”

Savvy sleep-hackers might recommend sticking a foot or two outside the covers to help with this heat exchange. But sometimes an exposed foot is not enough. Which is why in the middle of heat waves we'll crank up the air conditioning.

Given the ubiquity of air conditioning, Obradovich said he expected to find a less-pronounced effect. “The United States is a wealthy country on average and a fairly temperate country,” he said, able to use climate control technologies to smooth out spikes in hot weather. He said that countries like Brazil or India would probably fare worse, but scientists don't have the data.

The researchers found that the effect of unusually high temperatures was most pronounced in summertime. Two subsets of the population were disproportionately affected: people with incomes less than $50,000, who may not be able to afford running an air conditioner at night; and adults over 65, who are more susceptible to heat stress and poor temperature regulation.

Heat waves take an outsize toll on older adults, who are more likely to die of heat-related illnesses. Lack of sleep could compound these problems. “Poor sleep has been shown to increase susceptibility to disease, infection and viruses by decreasing immune function,” Mednick said, “along with other findings that increased sleep problems are associated with cancer, cardiovascular disease, obesity and diabetes.”

In a 2016 study, Loenhout tasked 113 elderly city inhabitants with filling out sleep diaries. He also measured the temperatures in their bedrooms between April and August in the Netherlands.

“We found a strongly significant relationship between exposed temperature and the number of hours that sleep disturbance was reported,” he said. Loenhout noted this method allowed scientists to record specifics about sleep loss, rather than the self-reports as in the study across the United States. (Obradovich agreed that “it would be much better if we had actual observations,” though the data set the Americans used had advantages of a more massive scale.)

The authors of the new report created a possible forecast of sleep in 2050 and 2099. If current trends continue, increasing temperatures could add six additional restless nights per month per 100 people, and 14 nights by 2099. It would be “hard to say” how severe the public health impact would be from these extra nights of bad sleep, Mednick said. “But it won't be good.”

Obradovich said those forecasts were only very rough estimates. “I don’t pretend to have any high degree of confidence what sleep will look like in 2099 or 2050,” he said. Air conditioning technology may, for instance, become more efficient or cheaper. But he also pointed out that adaptation to climate change is costly. “The more things we find that we need to adapt to,” he said, “the more we're going to have to pay.”

Dig Deeper: Environment + Wellness

Want to explore how a changing climate has impacted your well-being? Check out our curated list of stories below.

The hotter it gets, the harder it is for your body to cool as you sleep.

The higher the ultraviolet (UV) index, the more you need to protect your skin and eyes to decrease the chance of skin cancer and cataracts.

With a wetter and warmer climate, Lyme disease and ehrlichiosis could become more common as the number of tick bites increase.