Add standard debug function with profiling.

See Issue #331
Merge pull request #1 from OpenCollar/main

Add standard debug function with profiling.