How gene regulatory interactions adapt metabolism and stress responses to environmental conditions in single cells remains elusive despite intense studies, in part due to the difficulty of directly observing and measuring gene regulatory processes in vivo. We present a integrated experimental and computational setup consisting of a dual-input microfluidic device and accompanying image analysis software that allows long-term and highly accurate tracking of growth and gene expression in lineages of single cells exposed to controlled environmental changes.We study the response of E. coli cells to a sudden switch in carbon source from glucose to lactose. We observe that upon the switch all cells immediately arrest growth and that the lag times before cells resume growth is multimodal. We characterise the underlying molecular mechanism and demonstrate that the two main subpopulations correspond to cells with or without preexisting Lac proteins when the switch occurs. In addition, a direct comparison of these single-cell data with population growth curves in diauxic condition leads us to a new quantitative interpretation of lags during diauxic growth.Last, we present a general theoretical analysis that demonstrates that observing widespread lag distributions is not surprising from an evolutionary perspective: for isogenic populations with heterogeneous lag times, the population fitness is mainly determined by the response times of the fastest cells in the population, and insensitive to long tails of slow or non-responding cells. We discuss the optimality of the lac operon response described above in the light of this analysis.