Subcribing to a time event

  • Thread starter Thread starter agro_r
  • Start date Start date
A

agro_r

I use this code in my program:


while(form.Created)
{
form.CheckTime();
Application.DoEvents();
}


because I want my program to provide notifications on a specific time.
The problem is, that loop caused the CPU usage to be always 100%. I
don't want to sacrifice all the CPU cycle just for that task.

Isn't there a better way to do the equivalent of:

"If time is X, then call method D"

and have the system (os) raise the event (call method D) for my
program?

Thanks a lot.
 
Back
Top