Many neural systems extend their dynamic range by adaptation. We ex(cid:173) amine the timescales of adaptation in the context of dynamically mod(cid:173) ulated rapidly-varying stimuli, and demonstrate in the fly visual system that adaptation to the statistical ensemble of the stimulus dynamically maximizes information transmission about the time-dependent stimulus. Further, while the rate response has long transients, the adaptation takes place on timescales consistent with optimal variance estimation.