I have a recursive function that I am troubleshooting. I want to output the recursion depth...i.e. how many times the function calls itself.

If I use a static variable that increments at the top of the function and decrements at the bottom.

Will this accurately give me the depth level?

```
recurse()
  {
  static int depth = 0;
  depth++;
  /*
  do stuff
  recurse()
  */
  depth--;
  return return_value;
  }

```