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.

30 lines
782 B

2 years ago
  1. using SyntacticSugar;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace OrmTest.PerformanceTesting
  8. {
  9. public class PerformanceBase
  10. {
  11. public int count = 100;
  12. public void Execute(string title, Action fun)
  13. {
  14. PerformanceTest ptef = new PerformanceTest();
  15. ptef.SetCount(count);//执行count次
  16. ptef.Execute(
  17. i =>
  18. {
  19. fun();
  20. },
  21. res =>
  22. {
  23. Console.WriteLine(string.Format("Execute {0} time,{1}{2}", count, title, res));
  24. });
  25. }
  26. }
  27. }