t = new Timer(callback, null, Timeout.Infinite, Timeout.Infinite);
t.Change(0, Settings.FRAMERATE); //Start the timer
Now what do I do If I just say
while(true) { } nothing happens. If I say Thread.Sleep(500);this thread sleeps for a bit, then executes again, but the timer doesn't actually work. Do I need to put the timer in a sperate object or something Is Sytem.Threading.Timer the wrong one/should I use System.Timing.Timer
Thanks and best of wishes,
xycos

Using Timers in a console application
sjhuk
When I try to do anything(i.e. write to the console just to check if it's working or whatever) I get an exception. The console-writing one was an IOException
("The handle is invalid.") on Console.WriteLine("test");
Thanks and best of wishes,
xycos
sv_canada
If you're trying to create a multi-threaded application then you'll have to use a Thread object. A timer object executes a different thread on a given time. Try this:
static void Main(string[] args) {
Thread t = new Thread(new ThreadStart(Program.test));
t.Start();
}
static void test() {
Console.WriteLine("TEsting");
}
cheers,
Paul June A. Domag
SNMSDN
I've tried the code above using VS2005. Could you post your sample code on how your doing threading This would definitely speeden up the process of finding the solution to your problem...
cheers,
Paul June A. Domag
Sachin Choudhary
Other than that, as Paul said, show us the code - preferably as a short but complete example.
Jon