Millions of years ago, dinosaurs ruled the day while mammals mainly came out at night, Israeli researchers have discovered following an analysis of 2,415 living mammal species.

The researchers at Tel Aviv University and University College London used complex computer algorithms to reconstruct the likely behavior of our mammalian ancestors.

Their conclusions, published in the journal Nature Ecology & Evolution, shed light on why so many mammals today are nocturnal – that is, they are adapted to survive in dark environments. They had to steer clear of the daytime-dominating dinosaurs, some of which enjoyed a tasty mammalian meal.

When the dinosaurs disappeared from the earth, about 66 million years ago following a possible asteroid strike, mammals started to come out of their nighttime hiding places. The reason for the shift is not clear, but lead researcher Roi Maor says it may have included a “reduced risk of predation.”

“We were very surprised to find such close correlation between the disappearance of dinosaurs and the beginning of daytime activity in mammals, but we found the same result unanimously using several alternative analyses,” Maor said.

Still, most mammals remained nocturnal, with eyes and ears more attuned to living at night. Most mammalian eyes lack the photoreceptor that can process color in high light and are better at picking up limited light when it’s dark. This also helps explain why most mammals have a strong sense of smell and hearing – to better navigate the night world.

“Monkeys, apes and humans are the only diurnal mammals that have evolved eyes that are similar to other diurnal animals like birds or reptiles,” Maor explained.

While there is a strong correlation between the death of the dinosaurs and the daytime emergence of mammals, it’s not clear that one led conclusively to the other.

“It’s very difficult to relate behavior changes in mammals that lived so long ago to ecological conditions at the time, so we can’t say that the dinosaurs dying out caused mammals to start being active in the daytime. However, we see a clear correlation in our findings,” said research study co-author Prof. Kate Jones of UCL.

The work involved collaboration between UCL, Tel Aviv University, The Steinhardt Museum of Natural History at Tel Aviv University and the Zoological Society of London. It was funded by the Israel Science Foundation, Tel Aviv University, the Naomi Kadar Foundation and the UK’s Natural Environment Research Council.