A beagle will pee for about as long as a rhino, a race horse or any other large mammal.

An elephant's bladder can hold nearly 5 gallons (18 liters) of fluid, and yet, it can pee just as quickly as a cat.

A new study reveals that most mammals larger than rats urinate for about the same amount of time: 21 seconds. That's because their urethras are appropriately scaled to be a "flow-enhancing device," the researchers said.

The team hopes nature's efficient design for a system to quickly empty the bladder will inspire smarter engineering for water tanks and reservoirs, as well as fire hoses and water-filled backpacks. [The 12 Weirdest Animal Discoveries]

From toddlers to zoo animals

"I have a toddler at home and was changing her diaper and began thinking about how much urine an elephant would have," study leader David Hu, an assistant professor of mechanical engineering at the Georgia Institute of Technology in Atlanta, said of the inspiration for the research.

To compare peeing rates across the animal kingdom, Hu and his colleagues turned to two venues where it's easy to find fauna: the zoo and the Internet. The team looked at 28 videos of animals urinating on YouTube, and visited Zoo Atlanta to gather their own footage of 16 animals peeing and to collect urine in pieces of empty soda bottles.

The researchers found that animals lighter than 6.6 lbs. (3 kilograms), such as small rodents and bats, couldn't pee in streams; rather they urinated in a series of quick drops. Meanwhile, larger animals — from goats to gorillas to Great Danes — would release jets and sheets of urine when they had to go, and most took about 21 seconds to pee. Hu said he was surprised that an animal as large as an elephant would relieve itself just as quickly as a cat, whose bladder is maxed out with just a teaspoon (5 milliliters) of liquid.

"It's like emptying a swimming pool [and] a bathtub in the same time," Hu told Live Science in an email.

How it all comes out

The key factor behind this phenomenon is the length of the urethra, the researchers found. As an animal's body gets bigger, its urethra gets longer at a predictable ratio.

"All animals have urethras of the same aspect ratio: a length-to-width ratio of 18," Hu said. "This is rare among animals. Usually, body parts change in relative size, such as the eyes and brain."

With a longer urethra, the effects of gravity increase, which creates more pressure in the bladder and pushes the urine out faster, the researchers said.

The findings, which were detailed online last week in the Proceedings of the National Academy of Sciences, suggest the urethra isn't merely a conduit between the bladder and the outside world. Hu and his colleagues think this efficient biological system could be useful in the engineering world, and could even be scaled up.

"We realized that this phenomenon had no size limit," Hu said. "Animals use it for 5-mL or 18-L bladders, but there is no reason that it could not be extended to larger systems like swimming pools."

Follow Megan Gannon on Twitter and Google+. Follow us @livescience, Facebook & Google+. Original article on Live Science.