Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Action<int> countMillisecs = (ms) => { Console.WriteLine($"{ms}ms passed..."); };

            AsyncTimer timer = new AsyncTimer(countMillisecs, 5, 1000);
            timer.Start();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Action <int> countMillisecs = (ms) => { Console.WriteLine($"{ms}ms passed..."); };

            AsyncTimer timer = new AsyncTimer(countMillisecs, 5, 1000);

            timer.Start();
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            AsyncTimer timer1 = new AsyncTimer(SayHello, 10, 1000);
            timer1.Start();

            AsyncTimer timer2 = new AsyncTimer(PointlessMethod, 5, 2000);
            timer2.Start();
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            var timer = new AsyncTimer(() => Console.WriteLine("Halo"), 10, 1000);

            timer.Start();
            while (!timer.IsReady)
            {
            }
        }
Ejemplo n.º 5
0
        static void Main(string[] args)
        {
            var timer = new AsyncTimer(() => Console.WriteLine("Halo"), 10, 1000);
            timer.Start();
            while (!timer.IsReady)
            {

            }
        }
Ejemplo n.º 6
0
 static void Main(string[] args)
 {
     AsyncTimer first = new AsyncTimer(1000, 10, FirstStram);
     first.Start();
     AsyncTimer second = new AsyncTimer(750, 15, SecondStream);
     second.Start();
     AsyncTimer third = new AsyncTimer(550, 20, ThirdStream);
     third.Start();
 }
Ejemplo n.º 7
0
        static void Main(string[] args)
        {
            AsyncTimer print = new AsyncTimer(Print, 10, 1000);

            print.Start();
            AsyncTimer beep = new AsyncTimer(BeeP, 10, 500);

            beep.Start();
        }
Ejemplo n.º 8
0
 public static void Main()
 {
     AsyncTimer runningTimer = new AsyncTimer(Announce, 10, 1000);
     runningTimer.Start();
     Thread.Sleep(2020);
     Console.WriteLine("This is main program execution (delayed 2 sec.) not interupted by timer");
     Thread.Sleep(2500);
     Console.WriteLine("This is again main program execution not interupted by timer");
     Console.ReadKey();
 }
Ejemplo n.º 9
0
        static void Main()
        {
            AsyncTimer timer1 = new AsyncTimer(method1, 500, 10);

            timer1.Start();

            AsyncTimer timer2 = new AsyncTimer(method2, 1000, 10);

            timer2.Start();
        }
Ejemplo n.º 10
0
        static void Main(string[] args)
        {
            AsyncTimer timer1 = new AsyncTimer(Work1, 1000, 10);

            timer1.Start();

            AsyncTimer timer2 = new AsyncTimer(Work2, 900, 10);

            timer2.Start();
        }
Ejemplo n.º 11
0
 public static void Main()
 {
     AsyncTimer timer = new AsyncTimer(Action, 10, 1000);
     timer.Start();
 }