I have a code which when run, it executes series of lines in sequence. I would like to add a pause in between.
Currently, I have it like this
//do wo
The Thread.Sleep is what you want to use for this, you may want to use a more reasonable sleep period than 3 hours though.
Update:
After reading some of the comments, Thread.Sleep is probably not what you want. Use a System.Threading.Timer instead as others have suggested.
You can replace
Thread.Sleep(X);
by
Task.WaitAll(Task.Delay(X));
Thread.Sleep would typically be used to pause a separate thread, not in the main thread of your app.
Timer would typically be used to periodically cause the main thread to stop its normal operations and handle an event.
Either method can be used to periodically perform a function after a certain time interval.
What I wouldn't do is ask the main thread to sleep for 3 hours.
I think you should use a Monitor. It helps you to put a wait on objects and release the lock when you need to continue running the program.
You should find your answer here: Safe Thread Synchronization