Some of the most well-known dinosaurs that we think about today were separated by tens of millions of years. In fact, we're closer to the time of the T-Rex than T-Rex was to the time of the Stegosaurus. Unfortunately, that documentary The Land Before Time was totally lying to us.
We like to think of the Age of the Dinosaurs as this condensed period of time when every dinosaur was just wandering around the planet doing its dinosaur thing. But pre-history isn't like The Flintstones.
From Brian Switek at Smithsonian magazine:
Diplodocus, Apatosaurus, Allosaurus, Stegosaurus and their neighbors roamed western North America about 150 million years ago. This slice of time falls in the latter portion of the Jurassic. The traditional representatives of the latest Cretaceous scene—Tyrannosaurus and Triceratops—did not evolve until about 67 million years ago. By themselves, these dates are just labels, but think of them falling along evolution's timeline. About 83 million years separated Apatosaurus from Tyrannosaurus and Allosaurus from Triceratops. The so-called Age of Mammals—which began when the non-avian dinosaurs were wiped out—has been going on for about 66 million years. Less time separates us from Tyrannosaurus rex than separated T. rex from Stegosaurus.
Image of T-Rex "Sue" at the Field Museum via Getty