Consensus stability of multi-agent systems with time-varying sampling periods