We explore the analytical dependence of the free-electron laser (FEL) saturated power on the cavity detuning and discuss the dependence of the higher harmonics generated power on this quantity. We show that a suitable modulation of the cavity detuning may provide a pulsed behaviour of the laser, superimposed to the natural mode locking. The new temporal characteristics of the laser are discussed and it is shown that they can be controlled by controlling the cavity-length modulation period. We also study the effect of this modulation on the harmonic generation. The possibility of extending the same mechanism to a free electron laser operating with a storage ring is finally discussed and we show that, under certain conditions, it may modify the characteristics of the stationary configuration.