Hi everybody, I am in a situation, in which my program needs to do processing and then wait for some interval, let's say 5 seconds and the do the same processing again.
I don't know how to implement the logic.
I have developed a logic, the code is below:
private void ProcessEmail()
{
PprocessEmail:;
//Do whatever you want
System.Threading.Thread.Sleep(5000);
goto ProcessEmail;
}
What this code does: I only have to call this method once, it will do the processing then wait for 5 seconds and then again process.
So far above code is working fine, but i have heard using "goto" statements is not considered good in programming.
I want to know, will there be any side effect of this code or is there any other efficient way of doing the same thing.