By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,747 Members | 1,783 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,747 IT Pros & Developers. It's quick & easy.

What is the difference between Timer and Thread?

P: 3
I used Timer in VB. then, I want to convert a program with VB.net.

So, I used Thread instead of Timer.

Then, I am curious what difference they are?

plz, let me know it.

Thanks.
May 11 '10 #1
Share this Question
Share on Google+
1 Reply


Plater
Expert 5K+
P: 7,872
There are three basic timer objects:
System.Threading.Timer;
System.Timers.Timer;
System.Windows.Forms.Timer;

System.Windows.Forms.Timer is probably the one you are familiar with. It runs in the same thread as the message loop (generally the GUI thread) and it pretty basic, but requires the windows message pump to function.


System.Threading.Timer is the most complex. It runs in its own thread everytime it is fired and takes some research to use it correctly (being thread safe, etc etc)

In the middle ground is System.Timers.Timer, it functions similar to the windows.forms timer in implimentation but does not require the windows message pump(I don't believe). I like to think of it as the same as the windows.forms one, only for console applications.
May 11 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.