using System; using System.Threading; class MainClass { public static void DoCount() { for ( int i = 0; i < 10; i++ ) { System.Console.WriteLine( "Reached {0}", i ); } } [STAThread] static void Main(string[] args) { Thread t = new Thread( new ThreadStart( DoCount ) ); t.Start(); } }
Reached 0 Reached 1 Reached 2 Reached 3 Reached 4 Reached 5 Reached 6 Reached 7 Reached 8 Reached 9