The creation of threads : Thread Creation : Thread C# Examples


C# Examples » Thread » Thread Creation »

 

The creation of threads









    
using  System;
using  System.Threading;

class  MainClass  {

      public  static  void  Countdown()  {
        for  (int  i  =  10;  i  >  0;  i--)  {
            Console.Write(i.ToString()  +  "  ");
        }
    }

    public  static  void  Main()  {
        Thread  t2  =  new  Thread(new  ThreadStart(Countdown));
        t2.Start();
    }
}
    
   
  
   



Output

10 9 8 7 6 5 4 3 2 1


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Thread
» Thread Creation