Pause the processAsp.Net Hein11yAsked Apr 20, 2015, 6:51 PM EDT2 answersShareLinkedInXCopy linkSaveCan I pause process in C# for a while?Is there any function to pause the process? 2 AnswersKnow the answer? Post it. Somebody with the same question will find it here.Manoj BhoirRank #599 · 4K points11y agoPosted Apr 20, 2015, 8:51 PM EDT0Hi, What type of process you want to stop? If you have your own process program then you can use Thread.Sleep method from namespace System.Threading.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.aspx0Gowtham RajamanickamRank #57 · 29K points11y agoPosted Apr 20, 2015, 9:12 PM EDT0https://msdn.microsoft.com/en-us/library/d00bd51t%28v=vs.110%29.aspx0Join to answer this questionEvery answer you publish earns 20 SHARP.Create free accountSign in
Pause the processAsp.Net Hein11yAsked Apr 20, 2015, 6:51 PM EDT2 answersShareLinkedInXCopy linkSaveCan I pause process in C# for a while?Is there any function to pause the process?
Manoj BhoirRank #599 · 4K points11y agoPosted Apr 20, 2015, 8:51 PM EDT0Hi, What type of process you want to stop? If you have your own process program then you can use Thread.Sleep method from namespace System.Threading.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.aspx0
Gowtham RajamanickamRank #57 · 29K points11y agoPosted Apr 20, 2015, 9:12 PM EDT0https://msdn.microsoft.com/en-us/library/d00bd51t%28v=vs.110%29.aspx0
Manoj BhoirRank #599 · 4K pointsPosted Apr 20, 2015, 8:51 PM EDT
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
Gowtham RajamanickamRank #57 · 29K pointsPosted Apr 20, 2015, 9:12 PM EDT