Toddlers get a lot of credit for being able to fall asleep anywhere. But, whales (and other marine mammals) might have them beat.

The humpback whale in this video demonstrates how whales, dolphins and porpoises actually snooze -- suspended completely vertically in the water. The video, filmed off the Turks and Caicos Islands, was published by YouTube user URZALA prod.

The animal's sleep position may not look as comfortable as going supine on your pillow top queen, but for mammals that live in the water, sleeping up near the surface is about survival.

"They need to be close enough to breathe easily during sleep," Paul Manger, a neuroethologist at the University of Witwatersrand in Johannesburg, told The Huffington Post.

Whales, dolphins and other mammals that live in the water get the oxygen they need from the air. They "breathe" through the blowholes on the tops of their heads. So, the animals need to come to the water's surface both when they are awake and during sleep.

YouTube A humpback whale pops up to the surface. Whales "breathe" through the blowholes on the tops of their heads, so they need to be near the water's surface when they sleep.

Observing large groups of whales can be difficult, especially in the wild. But scientists who've observed some species say it's common for them to sleep in a suspended vertical position or a suspended horizontal position.

But what really makes whales sleep pros is their ability to sleep with only half their brain at a time.

"When whales and dolphins sleep, only half the brain is asleep at any one time with the other half being awake," Manger explained.

Scientists suspect whales, dolphins and other water-dwelling mammals sleep like this for a lot of reasons, including to monitor breathing, to keep an eye out for potential predators and to conserve body heat and avoid hypothermia (since mammals lose body temperature during sleep).

YouTube Another view of the sleeping humpback whale.

However, in one study, researchers captured footage of whales sleeping in the wild that showed they may sometimes sleep with both sides of their brain. The whales appeared to be totally asleep about 7 percent of the time -- less than two hours a day.

"While there are good ideas about why whales and dolphins sleep the way they do, none of these are, as yet, fully proven," Manger said.

Still, this video proves whales are pretty zen sleepers.

Sarah DiGiulio is The Huffington Post’s sleep reporter. You can contact her at sarah.digiulio@ .