programming-examples/c-sharp/Games_&_Threads/C# Program to Create a Simple Thread.cs

35 lines
668 B
C#
Raw Normal View History

2019-11-15 12:59:38 +01:00
/*
* C# Program to Create a Simple Thread
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
class program
{
public void WorkThreadFunction()
{
for (int i = 0; i < 5; i++)
{
Console.WriteLine("Simple Thread");
}
}
}
class threprog
{
public static void Main()
{
program pg = new program();
Thread thread = new Thread(new ThreadStart(pg.WorkThreadFunction));
thread.Start();
Console.Read();
}
}
/*
Simple Thread
Simple Thread
Simple Thread
Simple Thread
Simple Thread