Difference between suspension and sleep in a thread in C #

Thread.Sleep(5000);
stopwatch.Stop();
Console.WriteLine(stopwatch.ElapsedMilliseconds);
Thread.suspend(5000);
Console.WriteLine(stopwatch.ElapsedMilliseconds);
+4
source share
2 answers

Sleep means a sleeping stream of 5000 (ms). suspend means stopping the thread when the thread starts again.

+1
source

Sleep is used in one thread and pauses the thread for a certain period of time. While suspend is out of date .

Also check out the MSDN notes for Suspend:

. , . , , AppDomain . , , AppDomain, . .

+5

Source: https://habr.com/ru/post/1613641/


All Articles