The System.Environment namespace has a TickCount property, which returns the number of milliseconds relative to an internal system timer. (This value is slightly different from the Ticks value discussed in Chapter 6, “Storing Information in Variables,” because it represents milliseconds rather than nanoseconds and is stored in a variable of type Integer.) However, it is a great tool for measuring execution time, because we are not interested in the actual time value itself, but rather duration.
→ For more on dates and time spans, see Chapter 6, “Storing Information in Variables,” p.139
Listing 26.4 shows how you can subtract tick counts to determine the time it takes to execute a method: