Ticking noise

Got a 2002 Chevy Tracker, 165K miles, automatic trans. Twice this week, I’ve noticed a ticking noise when I turn off the car after driving a while. It sounds like a loud clock: tick, tick, tick, tick at a pretty fast pace. It seems to be coming from around the gas or brake pedal. I don’t know if the noise occurs when the car is running. It lasts for several minutes after the car is turned off. Any ideas on what’s going on?