How to find average lag time with variance & confidence of two time series
In a first approach, What you are looking for might be lagged correlation. You shift the trailling time serie by some variable time t and you look at correlation with the first time serie while varying the lag. The value of the lag which yield the biggest correlation is a good candidate for an estimation of time delay betweeen the two.
If you want more advanced statitics like variance (meaning that you have a variable lag) it might get more complex as you would have to identify which peak in the first time serie correspond to wich one in the second. Depending on your format of your time serie it might be easy or not. I would suggest to try a simple approach first : for each peak of your first time serie try to find the corresponding one in the second (first peak that appears after it for exemple). It might get complicated if some peaks overlap or the delay is too variable. Another option is to use more complicated things like Dynamic Time Warping Algorithms.