Timers

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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.