(CNN) -- Dinosaurs, it turns out, were on the hunt 24-7.
Researchers at the University of California, Davis, studied a bony ring found in the eyes of dinosaurs, lizards and birds and came up with a "most surprising" discovery: Some dinosaurs hunted at night.
The finding goes against the belief that they were active during the day, leaving mammals to move at night, according to an article Thursday in the journal Science.
"We found a mix of all kind of activities," said study co-author Lars Schmitz.
Take the velociraptor, which stalked the frightened children in the kitchen in the first "Jurassic Park" film.
The creatures were actually half the size of the ones in the movie, Schmitz told CNN, but they did in fact hunt at night, as depicted in the movie.
Schmitz, a postdoctoral researcher in the Department of Evolution and Ecology, and geology professor Ryosuke Motani examined the structure called the "scleral ring," which is lacking in mammals and crocodiles.
They measured the rings and eye sockets of more than 160 living species of birds and lizards and compared them with 33 fossils of dinosaurs, ancestral birds and pterosaurs.
Day-active animals have a small opening in the middle of the ring, Motani and Schmitz found. In nocturnal animals, the opening is much larger. For animals hunting both day and night the measurement was somewhere in the middle.
According to the findings, big plant-eating dinosaurs were active day and night, in part because they had to eat all the time. But they also had to deal with climate.
"Overheating can be a problem," for large herbivores, Schmitz said, and more of them shifted to being active at night.
Many small carnivore dinosaurs were night hunters. There was no finding on Tyrannosaurus rex, because there are no fossils with sufficiently well-preserved scleral rings, the university said in a statement.
Flying creatures, including early birds and pterosaurs, were mostly day-active, the study found.
The researchers say ecology and ancestry were at play.
Not all birds and lizards are active only in the day, said Schmitz, referring to the gecko lizard and two nocturnal birds, nightjars and goatsuckers. Geckos, he said, changed their physiology to be active at night.
The researcher said he wants to learn more about how habitat and feeding are intertwined with eye shape. And he wants to learn how diving birds, such as puffins, can see well above and in water.
CNN's Phil Gast contributed to this report.