Measurement of the plasma density is investigated to study plasma dynamics by adding reactive gas (O2) or rare gas (He) in Ar plasmas. When the O2 or He gas is added, plasma density is suddenly decreased, while the plasma density recovers slowly with gas off. It is found that the recovery time is strongly dependent on the gas flow rate, and it can be explained by effect of gas residence time. When the He gas is off in the Ar plasma, the plasma density is overshot compared to the case of the O2 gas pulsing due to enhanced ionizations by metastable atoms. Analysis and calculation for correlation between the plasma density dynamics and the gas pulsing are also presented in detail.