The .NET framework provides several ways to measure time intervals; you can use the DateTime.Now property or the Environment.TickCount property. However, these methods are not very precise. In fact, the Environment.TickCount can have a worst case resolution of 500 milliseconds. If you need to measure short time intervals, these methods may not be good options.
That's why we created the StopWatch class. It implements the high-resolution performance counter API functions of Windows. It can measure time intervals up to a tenth of a millisecond.
The classes are written in C# and VB.NET; they can be compiled to .NET modules or libraries to be used in other .NET languages. Since they rely on the Windows API, they will not work under Linux or FreeBSD.
|v1.0|| Initial release.||2002/05/02|