Daily Weekly Monthly

Daily Shaarli

All links of one day in a single page.

12/21/17

Note: bip-bip.cs
using System;
using System.Threading;
​
namespace myApp
{
    class Program
    {
        public static void Main() {
            Program ex = new Program();
            ex.StartTimer(600);
            ex.StartTimer(1200);
            ex.StartTimer(1800);
            Console.WriteLine("Press Enter to end the program.");
        }
​
        public void StartTimer(int dueTime) {
            Timer t = new Timer(new TimerCallback(TimerProc));
            t.Change(dueTime, 0);
        }
​
        private void TimerProc(object state) {
            Timer t = (Timer) state;
            t.Dispose();
            Console.Beep();
            Console.WriteLine("The timer callback executes.");
        }
    }
}