No they don't take a few seconds to work. They are very very fast at retarding the timing. They sample over 50 times a second to see if there is detonation.
Problem is, they are only used in closed loop control. When you are giving your throttle a wallaping the ecu is running in open loop and relies on pre-determined ignition values.
So the timing is running of fixed values, if you lean out, have a bad batch of fuel, etc etc it will still detonate.