public void run() { for (; ;) { Thread.Sleep(100); System.DateTime dt = System.DateTime.Now; if (dt.Second != sec) { TimeInfoEventArs timeinfo = new TimeInfoEventArs(dt.Hour, dt.Minute, dt.Second); if (Secchange != null) { Secchange(this, timeinfo); } } this.sec = dt.Second; this.mintue = dt.Minute; this.hour = dt.Hour; } }
public void InventoryTimeHasChanged(object Theclock, TimeInfoEventArs ti) { Console.WriteLine("current inventory time : {0}:{1}:{2}", ti.hour.ToString(), ti.minute.ToString(), ti.second.ToString()); }