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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access