static void Main() { _dateUpdateTimer = new Timer(5); _dateUpdateTimer.Callback += Do; _dateUpdateTimer.Start(); Console.WriteLine("Timer started!"); }
static void Main(string[] args) { Timer timer = new Timer(); TimerListener listener = new TimerListener(); listener.Subscribe(timer); timer.DoStuffEveryTTicks(190000); }
static void Main() { Timer timer = new Timer(5); timer.SomeMethods += FirstTestMethod; timer.SomeMethods += SecondTestMethod; timer.ExecuteMethods(); }
static void Main() { var timer = new Timer(9); timer.Methods = Tick; timer.Methods += Tock; timer.ExecuteMethods(); }
public static void Starting(int interval, int stopMilliSeconds) { Timer timer = new Timer(interval); Execute execute = Timer.PrintSeconds; while (timer.MilliSeconds < stopMilliSeconds) { execute(timer); timer.MilliSeconds += interval; System.Threading.Thread.Sleep(interval); } }
static void Main() { try { Timer timer = new Timer(3); timer.execute += PrintStars; timer.execute += PrintPlus; timer.Run(); } catch (Exception e) { Console.Error.WriteLine(e.Message); } }
static void Main() { Timer testTimer = new Timer(2); Console.WriteLine("Executing method \"DateNow\" every four seconds:"); testTimer.ExecuteMethod(DateNow); }
public void Subscribe(Timer t) { t.TimerExpired += new Timer.TimerEventHandler(OnEventMethod); }
public static void PrintSeconds(Timer timer) { Console.SetCursorPosition(3, 3); Console.WriteLine(timer.milliSeconds / 1000.0); }
static void Main() { Timer timer = new Timer(10); timer.StartTimer(); }