SyntaxFix
Write A Post
Hire A Developer
Questions
You can read up this property every few calls, Environment.StackTrace , and if the stacktrace exceded a specific threshold that you preset, you can return the function.
Environment.StackTrace
You should also try to replace some recursive functions with loops.