If EntryName = Parent.EntryName, then do not use profiler for this procedure (only upper level). Thou I'm not yet sure how to make it work flawlessly. Thou it'll make profiling recursive/inherited procedures much more readable.
And still will be problem if sequence proc1 <----> proc2 recursively used. Maybe, check all the parent-levels? Sounds nice, but not too efficient.
However, that issue may be solved "display-time", that'll be easier and better.
If aFunction = Parent.EntryName then begin
Result := Parent as TProfiler;
Result.IncreaseCount;
...
CurrentLevel.DecreaseCount;
if CurrentLevel.Count = 0 then GoUpALevel;
If
EntryName = Parent.EntryName
, then do not use profiler for this procedure (only upper level). Thou I'm not yet sure how to make it work flawlessly. Thou it'll make profiling recursive/inherited procedures much more readable. And still will be problem if sequence proc1 <----> proc2 recursively used. Maybe, check all the parent-levels? Sounds nice, but not too efficient. However, that issue may be solved "display-time", that'll be easier and better.