NET定时器

public static void Main()  
        { 
         Timer timer= new Timer();
            timer.Interval = 100;
            timer.Elapsed += new ElapsedEventHandler(Tick);
            timer.Start();
            Console.ReadLine();
            timer.Stop();
            Console.ReadLine();
            timer.Start();
            Console.ReadLine();
            timer.Dispose();
       
       
        }
       
      
        static void Tick(object sender, ElapsedEventArgs e)
        {
            Console.WriteLine("Tick...");
        }

 

posted @ 2015-07-08 14:34  wancient  阅读(121)  评论(0编辑  收藏  举报