Ways to measure performance quantitatively
There are many ways to measure performances of any running .NET code on top of CLR, including F#. So, any tool used to measure F# code is essentially usable for other programming languages on .NET CLR as well.
Again, the easiest way to objectively measure performance is by using quantitative measurements. The following are some common ways of measuring running codes:
- Using .NET timers
- Using native Win32 timer
- Using Visual Studio Diagnostic
- Running functions inside unit tests
The previous numbers are ordered from the subtlest and difficult to the quickest way of having statistical timing as performance measurements.
Using .NET timers
There are many timer classes in the .NET Framework but not all of them have a general purpose from the perspective of implementation details and in the context of execution environments.
In the context of execution environments, .NET timers are divided as follows:
- UI timers (timers that are run on an UI thread)
- Non-UI timer (timers...