public void Run() { while (true) { Thread.Sleep(1000); DateTime now = DateTime.Now; if (now.Second != second) { TimeInfoEventArg timeInfoEventArg = new TimeInfoEventArg( now.Hour, now.Minute, now.Second ); if (SecondChanged != null) { SecondChanged(this, timeInfoEventArg); } } } }
public void LogTime(object o, TimeInfoEventArg e) { Console.WriteLine($"Logging... {e.Hour.ToString()}:{e.Minute.ToString()}:{e.Second.ToString()}"); }
public void NewTime(object o, TimeInfoEventArg e) { Console.WriteLine($"Current Time: {e.Hour.ToString()}:{e.Minute.ToString()}:{e.Second.ToString()}"); }