Thread.Sleep() is the solution. It can be used to wait for one thread until another thread completes its work. OR . After executing one command, someone wants to wait until the later statement is executed. It has two overloaded methods. First you need to enter a parameter of type milisecond of type int, and the second is to use the parameter timepan. 1 Milisecond=1/1000s OR 1 second=1000 Miliseconds Suppose if someone wants to wait 10 seconds, the code will be ....
System.Threading.Thread.Sleep(10000);
for more information on Thread.Sleep() visit http://msdn.microsoft.com/en-us/library/274eh01d(v=vs.110).aspx
Happy coding .....!
source share