C# 2.0 - Ticker in console application, possible, how?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to use a ticker in a console-application? How can I do this?
 
By ticker, do you mean a timer? If so, look at the System.Timers.Timer
class - but be aware that its .Elapsed event is fired on a different thread
(unlike the System.Windows.Forms.Timer class which fires on the UI thread),
so you may need to perform some thread sync code.

Marc
 
Svein,
What is ticker? Is it a timer?
There are three timers in the .NET framework - Windows.Forms.Timer,
System.Threading.Timer and System.Timers.Timer. The first one cannot be used
because it needs a thread with a message loop to work, which console
application doesn't have. The other three can be used in any applications.
 

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

Back
Top