public static void ProfileMultipleTimes(String operationName, Action operation, Int32 numOfInvocations, Profiler profilingMethod) { for (Int32 i = 0; i < numOfInvocations; i++) { perfLabs.StartProfilers(); using (perfLabs.Step(profilingMethod, operationName)) { operation.Invoke(); } if (profilingMethod == Profiler.MVCMiniProfiler) { perfLabs.SaveToDataBase(); } perfLabs.StopProfilers(); } perfLabs.StartProfilers(); }
public void SetUp() { //This has nothing to do with PeformanceLabs. This is just to create a sample DB for profiling CreateDemoDB(); perfLabs = new PerformanceLabs(); MakeProfilerSettings(); perfLabs.StartProfilers(); }