Crocodiles, unlike most of the dinosaurs at the time, were able to take shelter in watering holes and wether out the worst of the extinction there. I guess when it got colder, they would hibernate and lower their metabolism to go longer without food. Non-avian dinosaurs were not able to do this and thus went extinct.