It's a last-ditch survival tactic. The brain expends as much energy as it can to look for any possible way of getting out of a deadly situation, which gives the impression that time is slowing down because you're thinking so much more in that one second. If it works you're left suddenly exhausted but alive; if it doesn't you're just dead.