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();