StopWatch vs Timer - When to Use

As far as I know the main differences are:

Timer

  1. Timer is just a simple scheduler that runs some operation/method once in a while
  2. It executes method in a separate thread. This prevents blocking of the main thread

Timer is good when we need to execute some task in certain time interval without blocking anything.

Stopwatch

  1. Stopwatch by default runs on the same thread
  2. It counts time and returns TimeSpan struct that can be useful in case when we need some additional information

Stopwatch is good when we need to watch the time and get some additional information about how much elapsed processor ticks does the method take etc.


This has already been covered in a number of other questions including here. Basically, you can either have Stopwatch with a Speed factor then the result is your "elapsed time". A more complicated approach is to implement Timer and changing the Interval property.