A
avivgur
Hello,
I have devised a console application that uses a System.Timers.Timer
and its Elapsed event.
The problem is that I want the program to continue to run so that each
time the event is raised, the handler will be executed.
I tried using a while(timer.Enabled) {} loop but it made the process
use 90% cpu in the task manager. What is the correct way to wait for
an event and keep the program alive in a console application?
Thanks,
Aviv.
I have devised a console application that uses a System.Timers.Timer
and its Elapsed event.
The problem is that I want the program to continue to run so that each
time the event is raised, the handler will be executed.
I tried using a while(timer.Enabled) {} loop but it made the process
use 90% cpu in the task manager. What is the correct way to wait for
an event and keep the program alive in a console application?
Thanks,
Aviv.