Can I pause process in C# for a while?
Is there any function to pause the process?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Gowtham RajamanickamPosted Apr 21, 2015, 1:12 AM
Manoj BhoirPosted Apr 21, 2015, 12:51 AM
See this example :
using System;
using System.Threading;
class Example
{
static void Main()
{
for (int i = 0; i < 5; i++)
{
Console.WriteLine("Sleep for 2 seconds.");
Thread.Sleep(2000);
}
Console.WriteLine("Main thread exits.");
}
}
Check this link for more details : https://msdn.microsoft.com/en-us/library/d00bd51t%28v=vs.110%29.aspx