Dwell times for light and electrons