Time-dependent measurement of the mode-competition phenomena among longitudinal modes in long-wavelength lasers