Question: Timer available for console application?

  • Thread starter Thread starter VB Programmer
  • Start date Start date
V

VB Programmer

I'm creating a console application. Can I use a timer control to do
something every 5 seconds?
 
VB Programmer,
Remember there are 3 different Timer objects in .NET.

For a console application I would not use the System.Windows.Forms.Timer
class, as this class is based on Forms, which means you need to get
Application.Run involved.

I would recommend using either System.Threading.Timer class or the
System.Timers.Timer class. Be sure to read about both as they use multiple
threads to handle the event.

Hope this helps
Jay
 
VB Programmer said:
I'm creating a console application. Can I use a timer control to
do something every 5 seconds?

System.Timers.Timer in assembly System.dll
 
Hello,

VB Programmer said:
I'm creating a console application. Can I use a timer control
to do something every 5 seconds?

System.Timers.Timer
System.Threading.Timer
System.Windows.Forms.Timer (for use with Windows Forms applications)

HTH,
Herfried K. Wagner
 
Back
Top