mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-03-11 20:19:27 +08:00
启动时间测试
This commit is contained in:
23
src/Yi.Framework/Yi.Framework.Web/TimeTest.cs
Normal file
23
src/Yi.Framework/Yi.Framework.Web/TimeTest.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user