Timers are a familiar entity to Visual Basic programmers, as they have been part of that language for many years. The Timer class is available on the .NET Compact Framework and is thus available for both C# and Visual Basic .NET.

Timers are objects that have a Tick method into which developers insert code. The code in the Tick method is executed at regular intervals, which the developer gets to set.

Thus, the Timer is very useful for executing a body of code at specific intervals. The Timer is meant for performing light work at regular intervals, but it is not a good choice for executing code that will take a long time to execute. For such cases a Thread is a far better choice.

The advantages of using Timers on the .NET Compact Framework ...

Get Microsoft® .NET Compact Framework Kick Start now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.