private static void Tick(Object state) { Crono crono = (Crono)state; crono.counter++; Console.WriteLine(crono.counter); }
private Project() { contador++; counter = 0; id = contador; Crono crono = new Crono(); TimerCallback timerDelegate = new TimerCallback(Tick); timer = new Timer(timerDelegate, crono, 0, 1000); /* * crono.timer = timer; * * while (crono.timer != null) * Thread.Sleep(0); * Console.WriteLine("Final del contador"); */ }