public void StopTraceMethod() { if (RunningMethods.Count > 0) { Method executedMethod = RunningMethods.Pop(); executedMethod.StopTrace(); ExecutionTime += executedMethod.ExecutionTime; if (RunningMethods.Count == 0) { RootMethods.Add(executedMethod); } } }
public void StartTraceMethod(Method method) { if (RunningMethods.Count() != 0) { Method topMethod = RunningMethods.Peek(); topMethod.AddNestedMethod(method); } RunningMethods.Push(method); method.StartTrace(); if (RunningMethods.Count > MaxStackDeep) { MaxStackDeep = RunningMethods.Count; } }