I’ve experienced this. Someone pulled a gun on me with the intent of killing me. Past memories flashed by incredibly fast in a slideshow sort of format, all in a second or so. I don’t know why it happened, but I figured my mind was trying to find a way out of the situation.