例 次の例では、スレッドを作成して開始します。 using namespace System; using namespace System::Threading; public ref class ThreadWork { public: static void DoWork() { for ( int i = 0; i < 3; i++ ) { Console::WriteLine( "Working thread..." ); Thread::Sleep( 100 ); } } }; int main() { ThreadStart^ myThreadDelegate = gcnew ThreadStart(&ThreadWork::DoWork); Thread^ thread1 = gcnew Thread( myThreadDelegate ); thread1->Start(
![Thread.Start メソッド (System.Threading)](https://cdn-ak-scissors.b.st-hatena.com/image/square/d6e4cb632c7025e9f5e05fd314fbf6dcd6144e8d/height=288;version=1;width=512/https%3A%2F%2Flearn.microsoft.com%2Fen-us%2Fmedia%2Fopen-graph-image.png)