示例#1
0
        public static void Main(string[] args)
        {
            AsyncTimer first = new AsyncTimer(SaySomething, 10, 1000);
            first.StartTimer();

            AsyncTimer second = new AsyncTimer(SaySomethingAgain, 10, 1000);
            second.StartTimer();

            Console.WriteLine("work");
        }
示例#2
0
        public static void Main(string[] args)
        {
            AsyncTimer first = new AsyncTimer(SaySomething, 10, 1000);

            first.StartTimer();

            AsyncTimer second = new AsyncTimer(SaySomethingAgain, 10, 1000);

            second.StartTimer();

            Console.WriteLine("work");
        }
示例#3
0
        static void Main()
        {
            AsyncTimer asyncTimer = new AsyncTimer(PrintTime, 10, 2000);
            Task       startTimer = asyncTimer.StartTimer();

            Console.WriteLine("The task is completing, spam here: ");

            while (startTimer.IsCompleted == false)
            {
                Console.ReadLine();
            }

            Console.WriteLine("The task has been completed!");
        }