using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.Remoting.Messaging;
using System.Text;
namespace ConsoleApplication1
{
static class Program
{
static void Main(string[] args)
{
int timeS = System.Environment.TickCount;
int timeE = System.Environment.TickCount;
var timeSpan = new Stopwatch();
timeSpan.Start();
Excute(() => { Console.WriteLine("test"); });
timeSpan.Stop();
Console.WriteLine(timeSpan.ElapsedMilliseconds);
Console.ReadKey();
}
public static void Excute(Action code)
{
code();
}
}
}
C#计算运行时间
最新推荐文章于 2024-05-28 08:52:41 发布