Monday, 23 November 2015

Simple Threading in C#

using System;
using System.Threading;
class Program
{
    static void Main()
    {
        Thread t = new Thread(Test.DemoMethod);
        t.Start();
    }
}
class Test
{
    public static void DemoMethod()
    {
        for (int i = 1; i <= 10; i++)
        {
            Console.WriteLine(i);
        }
    }
}

No comments:

Post a Comment