Tree Frogs in Thailand can speed up their life cycle and hatch early to avoid being eaten by a predator, a new study shows.

Life events are generally considered as rigid, occurring at a specified time. However, nature can be flexible in some cases, allowing organisms to grow up at a much faster rate during stressful conditions.

Researchers at the National University of Singapore and colleagues have found that Hansen's tree frogs have the ability to sense danger while still in the embryo stage.

"Both young and old Hansen's tree frog embryos are able to hatch earlier when disturbed," said Sinlan Poo from the National University of Singapore.

"Hatching is a plastic or flexible event in the life cycle of this frog, because its embryos are able to respond to acute signals, such as predation, by escaping into the next life-stage," explained David Bickford of the National University of Singapore, according to a news release.

Hansen's tree frog is native to Thailand and parts of Cambodia. These amphibians begin their life as part of a gelatinous pod hanging from a tree over a season pool of water. Moments before hatching, the entire clutch detaches from the tree and falls into the pool. The hatchlings then emerge out of the gelatinous mass and start swimming. The process looks simple, but requires precise timing and luck.

One of the major dangers faced by these little frogs is Hexacentrus cf. Unicolor, which is a type of katydid. These crickets feast on adult and young frogs.

During the study, the researchers found that hatchlings emerged earlier than expected when the gelatinous mass was disturbed than when it was left untouched. The research shows that the frogs can detect a threat via chemicals released by a broken embryo.

For the research, the scientists monitored frog behavior at an open air laboratory at the Sakaerat Environmental Research Station in Thailand. The team used time-lapse cameras to detect growth of 70 frog clutches.

The study is published in the journal Behavioral Ecology and Sociobiology.