public void going() { while (!(Hour == Alarm_h && Minute == Alarm_m && Second == Alram_s)) { Second += 1; if (Second == 60) { Second = 0; Minute += 1; } if (Minute == 60) { Minute = 0; Hour += 1; } if (Hour == 24) { Hour = 0; } Timeargs time_tick = new Timeargs() { Hour_ = Hour, Minute_ = Minute, Second_ = Second }; ToTick(this, time_tick); } Timeargs time_alarm = new Timeargs() { Hour_ = Hour, Minute_ = Minute, Second_ = Second }; ToAlarm(this, time_alarm); System.Threading.Thread.Sleep(1000); }
void ToTick(object sender, Timeargs time) { Console.WriteLine($"Tick!:[ { time.Hour_} : { time.Minute_ } : { time.Second_ }]"); }