I have a method that I want to call a method (will be referred to as myFanc) in a split stream every 3 seconds
The code below can easily do this,
Timer myTimer = new Timer();
myTimer.Elapsed += new ElapsedEventHandler( myFanc );
myTimer.Interval = 3000;
myTimer.Start();
The above code may cause a call to myFanc while another call to myFanc has not yet completed
My problem is that I also want myFanc to finish before I call it Agian, so basically I want to call the method in a separate thread every 3 seconds after myFanc is completed, how can I do this?
I don’t mind if the solution does not use the Timer class, I just want this behavior to work.
source
share