programming-examples/c-sharp/Games_&_Threads/C# Program to Pause a Thread.cs
2019-11-15 12:59:38 +01:00

27 lines
531 B
C#

/*
* C# Program to Pause a Thread
*/
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");
Console.ReadLine();
}
}
/*
Sleep for 2 Seconds
Sleep for 2 Seconds
Sleep for 2 Seconds
Sleep for 2 Seconds
Sleep for 2 Seconds
Sleep for 2 Seconds
Main thread Exits