DateTime中Ticks的使用

    System.Threading.Thread.Sleep(2000);
            Console.WriteLine("Has Conme");
            long start = DateTime.Now.Ticks;
            long end = DateTime.Now.Ticks;
            long span = end - start;
            while (true)
            {
                if (span>=20000000)//等于2秒的时候输出
                {
                    Console.WriteLine("Has Conme");
                    break;
                }  
 
                end = DateTime.Now.Ticks;
                span = end - start;
            }
                   
         
            Console.Read();

posted @ 2013-04-11 19:15  Predator  阅读(284)  评论(0编辑  收藏  举报