i’ve 2 functions like this:
//Function1
public int function1()
{
...//some code
}
//function2
public double function2()
{
...//some code
}
//Main
public static void Main(string[] args)
{
function1()
function2()
}
in my Main method, how can i call function1() first and then function2(); and then sleep for 30 sec , and again call function1() first and after function2(); and sleep for 30 sec and so on… ?
thanks
Use a non-terminating
whileloop in combination withThread.Sleep().Naturally in a real program you would want to include some mechanism to terminate the loop.
Also, I would concur with Dan Bryant’s comment above.
Sleepis seldom the best solution to a problem and a timer would seem more appropriate here.