Hello everyone!
I know how to use a Timer class:
static void Main(string[] args)
{
System.Timers.Timer MyTimer = new System.Timers.Timer();
MyTimer.Elapsed += new System.Timers.ElapsedEventHandler(MyTimer_Elapsed);
MyTimer.Interval = 2000;
MyTimer.Enabled = true;
//etc.
}
static void MyTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
//do something every 2 seconds
}
What I like to do is draw something every 2 secs during a draw method in a loop like:
>while condition true
> Draw object
> Wait 2 secs
>end loop after condition false
I could use a very long empty for loop as a wait method, is there a better way?
Have looked around here and there but found nothing usefull.
Any help (as always) is greatly appreciated:)