O'Reilly logo

C# 2008 and 2005 Threaded Programming: Beginner's Guide by Gastón C. Hillar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

BackgroundWorker and Timer

At first sight, developers who have already worked with the Timer component can find certain similarities between the Timer and the BackgroundWorker. However, they are completely different, and they have different purposes.

The Timer is a component prepared for triggering an event at specified intervals. When the event is triggered, the code written in its handler is executed. We can specify the interval for triggering the event, and also, as with any other event, we can program the code in its handler. It is very useful for executing a block of code at specified intervals. However, this is done in the application's main thread, and hence, during all the time that the code corresponding to the Timer event is running, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required