You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
782 B
31 lines
782 B
7 years ago
|
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));
|
||
|
});
|
||
|
|
||
|
}
|
||
|
}
|
||
|
}
|