using System.Diagnostics; namespace 测试 { internal class Stopwatch1 { public Stopwatch1() { var a = new Stopwatch(); a.Start(); Thread.Sleep(5000); a.Stop(); var b = a.ElapsedMilliseconds; } } }