For millennia, dogs have shared our lives — and, often, our beds.

That may be in part because humans and dogs have similar sleep times and habits. Like us, dogs can have trouble falling asleep at times, their sleep habits change with age, and they snore.

It’s no wonder that sleep researchers find dogs to be important models for studying human sleep-related cognition. Humans and dogs tend to sleep primarily at night. A dog’s daily sleep duration is eight to 14 hours, compared with eight hours for humans and 12 to 15 hours for cats.

Working with family dogs and noninvasive polysomnography (sensors to monitor physiological signs like brain waves, eye movements, heart rate and breathing patterns), researchers are able to learn more about how sleep affects cognitive processes such as memory consolidation and emotion processing. Along the way, they’ve also learned more about canine sleep experiences.

If you are middle-aged or older, or live with a dog that is, you probably won’t be surprised to learn that older dogs sleep more. Dogs that have had a physically or mentally active day because of competition or advanced training sleep soundly, too. Compared with dogs that have had a more typical (read: less active) day, they become drowsy earlier, moving quickly to the sleep stages called NREM (non-rapid eye movement) and REM (rapid eye movement).

The NREM stage is when the body repairs and regrows body tissues, builds bone and muscle, and strengthens the immune system. REM sleep stimulates areas of the brain that aid learning and are associated with increased protein production. We don’t know, though, whether dogs experience the intense dreams that humans do during REM sleep.

“Dogs are not able to tell us what they experienced during their sleep, so we can’t tell whether they dream or not,” said Vivien Reicher at Eötvös Loránd University in Budapest, Hungary, lead author of a sleep study in family dogs published in the Journal of Sleep Research. “Intuitively, of course, we can claim that a dog is dreaming when he or she seems to run, or whines while sleeping.”

The signs of dogs dreaming in REM sleep are similar to that of humans; rapid eye movements, irregular respiration and heart rate, limb and body movements and twitching.

Dogs with smushed faces, such as bulldogs, French bulldogs and pugs, may have trouble sleeping. (If you have one, you’ve probably been kept awake by its snoring.) While more investigation needs to be done, Reicher said in an e-mail, these dogs’ poor respiration, related to their abnormal upper airway anatomy, can result in decreased sleep quality.

Dogs also have a problem that many of us can identify with: They don’t fall asleep easily in strange places. At home, they reach REM sleep earlier than they do if they’re staying at someone else’s home, a boarding kennel or a sleep laboratory. But dogs that are used to sleeping away from home reach NREM and REM sleep much more quickly than dogs that rarely leave home.

“These findings are consistent with human studies, suggesting that a novel and potentially stressful environment plays a crucial role in sleep quality,” Reicher said. “Presumably, dogs that sleep only at home are more sensitive to laboratory conditions, and those dogs that regularly accompany their owners for longer periods outside their home environment are more experienced and therefore less excited” at the sleep laboratory.

What does all this tell us about ourselves? Dogs are increasingly recognized as models for human neuropsychiatric conditions, including sleep disorders such as narcolepsy (which can be congenital, or inherited, in dogs) and the disordered breathing that causes snoring and sleep apnea.

“Dog sleep research might open up new directions for investigation of the links between environmental factors and brain mechanisms underlying cognitive dysfunctions, which could help [us] better understand complex dog and even human phenotypes,” Reicher said.

One way or another, our dogs are going to help us sleep better.