SyntaxFix
Write A Post
Hire A Developer
Questions
Use a Profiler
Your approach will work nevertheless, but if you are looking for more sophisticated approaches. I'd suggest using a C# Profiler.
The advantages they have is:
There are many available open-source as well.