SqlSugar/Src/Asp.Net/MySqlTest/PerformanceTesting/PerformanceBase.cs
2017-06-24 00:25:13 +08:00

31 lines
782 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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));
});
}
}
}