Skip to content

Pause the process

Asp.Net Hein

Asp.Net Hein

Asked Apr 20, 2015, 6:51 PM EDT2 answers
Share
LinkedInX
Can I pause process in C# for a while?
Is there any function to pause the process? 

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Manoj Bhoir
    0
    Hi, 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.aspx
    0
  • Gowtham Rajamanickam
    0
    https://msdn.microsoft.com/en-us/library/d00bd51t%28v=vs.110%29.aspx
    0