Amount of time between discovery of killer asteroid and impact?

I’m hoping there’s a GQ answer to this.

So what is conceivably the shortest amount of time between the discovery of a potential catastrophic astronomical impact with Earth and the impact? Are we guaranteed to have years or decades of warning and planning or could I go sleep one night and low and behold, NASA was asleep at the switch and life is vaporized overnight?

Consider “catastrophic” as a impact that has the potential to destroy a sizable part to all of humanity.

I saw a History Channel special on this at like 2AM once so my memory may be distorted, but I recall it being something like 6 months 'til potential impact before they could be certain it would hit us (or not). However you could conceivably say it can catch us COMPLETELY off guard if the astronomers make a miscalculation and think it won’t hit us. You go to bed one night knowing it will not hit us and it turns out everything is gone the next morning, oops. However I don’t consider that likely.

I’ve heard on numerous occasions that are many directions from which a killer asteroid could approach the Earth in which we would receive little or no warning.

NASA isn’t paying as close attention as you might think:

Comets are less predictable and faster-moving. I’ve seen History Channel Mega-Disaster shows that assert comets are a threat we’d be less able to forsee and divert.

Sailboat

A few near-impactors have been discovered only after they had their closest approach to the Earth, and were already on their way away. Admittedly, none of those were of the scale of the dino-killer, but they would still have been huge disaster if they had hit.

Once you see an object and take an interest in it, it’s not too hard to figure out what it’s going to do. The real threat isn’t the ones we notice and which take a while to calculate; it’s the ones we never see at all.

We can divide dangerous bodies into two groups. One group is of bodies that we know about right now. We can compute their orbits way into the future, and predict how likely they are to collide with Earth, although the farther into the future, the less accurate it will be. These objects are not heading directly for Earth at the moment, but orbital changes might make them a threat. This group could potentially be diverted, since we will have a lot of time to watch them.

The other group is objects heading directly for us from some source not expected and at a great enough distance that they cannot be seen until dangerously close. Still, I imagine anything big enough to do really serious damage would most likely be picked up by the time they enter the Solar System, and wouldn’t that give us months to years of warning? (Not that it would be sufficient to act, but it’s more than waking up dead and not knowing it was coming.)

My question is, is anyone keeping watch for the second group, or are we just relying on sharp-eyed stargazers to find them by luck?