private static void StartCollectMachineStatisticsTimer(string host, string user, string password, int sshPort, string path, TimeSpan interval) { var timer = new Timer(interval.TotalMilliseconds); timer.AutoReset = true; timer.Elapsed += (sender, e) => { ShellHelper.CollectMachineStatistics(host, user, password, sshPort, path); }; timer.Start(); }