110,533
社区成员
发帖
与我相关
我的任务
分享
class Program
{
static void Main(string[] args)
{
//dt中存放你的时间,可以把需要的时间转换成一个秒数,这里设定为10秒
DateTime dt=new DateTime(10);
long ticks = dt.Ticks;
while (true)
{
System.Threading.Thread.Sleep(1000 * 1);
if (ticks == 0)
{
break;
}
else
{
ticks--;
}
Console.WriteLine("test:" + ticks);
}
Console.WriteLine("game over");
Console.ReadLine();
}
}