Ejemplo n.º 1
0
        static void Main()
        {
            AsyncTimer timer = new AsyncTimer(SaidGoodMorning, 1000, 10);

            timer.Start();

            timer = new AsyncTimer(Work2, 500, 20);
            timer.Start();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            // method to print the current time to file (for testing)
            Action method = delegate()
            {
                using (System.IO.StreamWriter file = System.IO.File.AppendText(@"../../test.txt"))
                {
                    file.WriteLine(DateTime.Now);
                }
            };

            // create the timer to call the method 10 times on each 1 sec
            AsyncTimer timer = new AsyncTimer(method, 10, 1000);

            // Just to test the timer we can wait for user input. The current date time will be printed in the consol
            Console.ReadLine();
        }
Ejemplo n.º 3
0
        public static void Main()
        {
            AsyncTimer timer = new AsyncTimer(Action, 8, 500);

            Console.ReadLine();
        }
 public static void Main()
 {
     AsyncTimer timer = new AsyncTimer(Action, 8, 500);
     Console.ReadLine();
 }