Time lags of flaring AGN