using System; namespace C_Thread{ public class Program{ public static void Main() { TimeSpan span = TimeSpan.FromMilliseconds(Environment.TickCount); Console.WriteLine("{0}", span.TotalSeconds); } } }
运行效果
e:\project\dotnetcore\console1>dotnet run 421.953