Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Thread.Sleep(期間)とThread.CurrentThread.Join(期間)の正確な違いは何ですか?
まあ、ターゲットスレッドが終了するまでスレッドをブロックしThread.Sleepながら、特定の時間スレッドをブロックします。Thread.Join
Thread.Sleep
Thread.Join
Thread.CurrentThread中断されている間は終了しないことを考慮すると (外部で終了しても、死んでいるため違いはありません)、最終結果は同じになります。ただし、使用は明らかですが、Join混乱を招きます。Sleepどちらを使用するかを決めることは、競争ではありません。
Thread.CurrentThread
Join
Sleep