static void Main()
{
ts = new TimeSpan(0,0,0);
new Thread(Count).Start();
}
public static bool Stop { get; set; }
public static TimeSpan ts { get; set; }
static void Count()
{
while (!Stop)
{
TimeSpan t = TimeSpan.FromMilliseconds(1);
ts.Add(t);
// 休眠1毫秒
Thread.Sleep(TimeSpan.FromMilliseconds(t));
}
}