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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Timer in Console application 6
Xbox Series X anomaly (sort of) 4
Timer Control query 3
threaded timer 1
Which Timer? 15
Console App Theory 1
Concurrent Timers... 2
Using System.Threading.Timer (SOS!) 4

Back
Top