mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-20 18:48:09 +08:00
-
This commit is contained in:
30
SqlServerTest/PerformanceTesting/PerformanceBase.cs
Normal file
30
SqlServerTest/PerformanceTesting/PerformanceBase.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using SyntacticSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OrmTest.PerformanceTesting
|
||||
{
|
||||
public class PerformanceBase
|
||||
{
|
||||
public int count = 100;
|
||||
public void Execute(string title, Action fun)
|
||||
{
|
||||
PerformanceTest ptef = new PerformanceTest();
|
||||
ptef.SetCount(count);//执行count次
|
||||
ptef.Execute(
|
||||
i =>
|
||||
{
|
||||
fun();
|
||||
|
||||
},
|
||||
res =>
|
||||
{
|
||||
Console.WriteLine(string.Format("Execute {0} time,{1}{2}", count, title, res));
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user