fix issue 9783: fix tree time when profiling recursive functions
Merge pull request #461 from rainers/fix_profile_treetime

fix issue 9783: fix tree time when profiling recursive functions