public void Stop()
{
if (DurationMilliseconds == null)
{
DurationMilliseconds = Profiler.GetRoundedMilliseconds(Profiler.ElapsedTicks - _startTicks);
Profiler.Head = ParentTiming;
if (HasChildren)
{
decimal result = 0;
foreach (var child in Children)
{
result += child.DurationMilliseconds.GetValueOrDefault();
}
if (result.CompareTo(DurationMilliseconds.GetValueOrDefault()) > 0)
{
var delta = result - DurationMilliseconds;
string name1 = Name;
System.Diagnostics.Debug.WriteLine("Inside: " + delta + " -- " + name1);
DurationMilliseconds = result + delta;
}
}
}
}