Ejemplo n.º 1
0
        public static void Main(string[] args)
        {
            Action getTime = GetTime;

            var timer = new AsyncTimer(getTime, 10, 1000);
            timer.StartTimer();
        }
Ejemplo n.º 2
0
        public static void Main(string[] args)
        {
            Action getTime = GetTime;

            var timer = new AsyncTimer(getTime, 10, 1000);

            timer.StartTimer();
        }
Ejemplo n.º 3
0
        static void Main()
        {
            Action<int> generateRandomLetterOrChar = GenerateRandomLetter;

            const string message =
                "I'm running independly of the timer, so I show up before the timer is up. Anyway here's 111 random characters:";

            var timer = new AsyncTimer(generateRandomLetterOrChar, message.Length, 70);
            timer.Run();

            Console.WriteLine(message);
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            Action action = new Action(PrintSomething);
            AsyncTimer t = new AsyncTimer(action, 5, 1000);

            t.Run();

            string msg = Console.ReadLine();

            while (!msg.ToLower().Equals("quit") && !msg.ToLower().Equals("exit"))
            {
                msg = Console.ReadLine();
            }

            t.thread.Join();
        }