Newer cars have diagnostic equipment onboard that continuously tests for emissions and will light up your check engine light if there's a problem. That's why inspections on modern cars are so quick - they plug in their computer, check the data in the car, and you're on your way.
Older cars...