This might be the impression one gets from watching movies or television shows, but its not reality. Anyone who has either trained with a handgun, or even just viewed videos of real-world confrontations will know that this isn't the case. In many encounters you have almost no time. Racking the slide and acquiring the target adds a massive amount of time (its even worse when you are under pressure).
Most defensive uses of a firearms occur at a short distance, less than five yards. It takes very little time to cover the distance. For those who are interested, here is a video covering what it looks like when someone with a knife runs straight at someone at 21 feet, you will see why the idea that people have time to rack the slide is absurd (https://youtu.be/_2zfw_4DYdQ?t=79).