Foreground Thread Sleep
using System;
using System.Threading;
public class MainClass
{
private static void MyFunction() {
Thread.Sleep( 5000 );
Console.WriteLine( "Exiting extra thread" );
}
static void Main() {
Thread thread1 = new Thread( new ThreadStart(MyFunction) );
thread1.Start();
Console.WriteLine( "Exiting main thread" );
}
}
Output Exiting main thread
Exiting extra thread
|
HTML code for linking to this page:
Related in same category :
-
-
|