启动时间测试

This commit is contained in:
橙子
2023-01-16 21:10:00 +08:00
parent 506686b11e
commit 46b176fc59
5 changed files with 36 additions and 8 deletions

View File

@@ -0,0 +1,23 @@
using System.Diagnostics;
namespace Yi.Framework.Web
{
public class TimeTest
{
public static Stopwatch Stopwatch { get; set; }
public static void Start()
{
Stopwatch=new Stopwatch();
Stopwatch.Start();
}
public static void Result()
{
Stopwatch.Stop();
string time = Stopwatch.ElapsedMilliseconds.ToString();
Console.WriteLine($"本次运行启动时间为:{time}毫秒");
Stopwatch.Restart();
}
}
}