Astronauts often suffer from sleep deprivation during space flight and in the months leading up to a mission, a new study finds.

In addition, about three-quarters of astronauts in the study said they took sleeping pills while they were in space — with some taking the pills just a few hours before they woke up — a finding that is concerning because the drugs may impair alertness and the ability to respond to emergency situations, the researchers said.

"The ability of a crew member to perform at their best if awakened from sleep by an emergency alarm could be jeopardized by use of sleep-promoting drugs," the researchers wrote in their study published in the Aug. 8 issue of the journal the Lancet Neurology. [7 Everyday Things that Happen Strangely In Space]

The findings highlight the need to develop better ways to help astronauts sleep, both during training and in space flight, the researchers said.

In the study, researchers analyzed information from 64 astronauts who were aboard space shuttle flights between 2001 and 2011, and from 21 astronauts who stayed at the International Space Station (ISS) between 2006 and 2011.

The astronauts wore devices on their wrists called actigraphs to track their sleep, and also kept a sleep diary. Overall, the researchers collected sleep data from more than 4,200 nights in space and 4,000 nights on Earth.

Astronauts got less sleep in the months leading up to their mission, and during space flight, than they did in the week after a mission.

For example, about three months before a space flight, astronauts averaged less than 6.5 hours of sleep a night (as recorded by the actigraph) — which is about half an hour less than the average American, and about 40 minutes less than the time they spent sleeping when they got back from the mission.

Such sleep loss often occurs when people have a high-stakes event in the near future, or a heavy workload, the researchers said. "It is not unlike what happens on Earth when you have stress, and a lot to do before difficult work, or an exam or an athletic event or travel," said study researcher Laura Barger, an associate physiologist at the Brigham and Women's Hospital Division of Sleep and Circadian Disorders in Boston.

During space flight, astronauts got around six hours of sleep per night. Space shuttle crewmembers got eight hours of sleep on only 0.3 percent of nights they were in space.

Astronauts reported that they had difficulty sleeping because of high workloads, noise and uncomfortable temperatures (either too hot to too cold), Barger told LiveScience. The "weightlessness" that astronauts experience may also affect sleep (astronauts attach themselves to walls or the ceiling to sleep).

Seventy-five percent of astronauts aboard the ISS, and 78 percent aboard the space shuttle, reported using sleep aids at some point during their time in space. What's more, although the astronauts said that they fell asleep faster when they took sleep medication, the study found that the pills did not help them sleep any longer.

"Such a marginal benefit should be balanced against the risks associated with use of hypnotic drugs," the researchers wrote. Future research will also look into whether sleep drugs work as well in space as they do on Earth, Barger said.

Changes in sleep schedules, as well as exposure to certain wavelengths of light, may be alternative ways to improve sleep in space, the researchers said. Short wavelengths of light, in the blue range, promote alertness, so avoiding this wavelength of light before bed may help promote sleep, Barger said.

Studies on Earth show that sleep deprivation is linked with impaired performance on tasks. However, the new study was not able to assess whether sleep loss led to more errors or problems with performance in space, and this will be examined by future research, the researchers said.

Follow Rachael Rettner @RachaelRettner. Follow Live Science @livescience, Facebook & Google+. Original article on LiveScience.

Related on LiveScience and MNN:

This story was originally written for LiveScience and was republished with permission here. Copyright 2014 LiveScience, a TechMediaNetwork company.