當前位置:編程學習大全網 - 網站源碼 - c# 做壹個 秒表 要源碼

c# 做壹個 秒表 要源碼

簡單寫壹個吧,精度不會比Timer高:

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

}

}

  • 上一篇:籃球吾愛小說txt全集免費下載
  • 下一篇:五軸刀尖跟隨功能怎麽用
  • copyright 2024編程學習大全網