Dolphins can stay alert and active for more than two weeks at a time by sometimes staying only half awake, according to new research.

Scientists from the National Marine Mammal Foundation in San Diego say they found that dolphins sleep with only half of their brains at a time, while the other half remains awake.

By switching to the side that is active, they can remain awake for many hours or days, researcher Brian Branstetter wrote in the journal PLoS ONE.

He and colleagues found the astonishing level of stamina in the marine mammals by putting them to work with continuous echo location games, in which they maintained a 99 percent success rate over five days straight.

Other mammals would have demonstrated sleep-deprivation systems in a far shorter time. Similar results were found in a 30-day test that had to be cut in half due to an approaching storm.

“The demands of ocean life on air breathing dolphins have led to incredible capabilities, one of which is the ability to continuously, perhaps indefinitely, maintain vigilant behavior through echolocation,” said Branstetter.

The finding could explain how dolphins can remain on the constant lookout for sharks.