Alex Rivera | Logout

When is it sensible to use Thread.Sleep()?

Asked 2012-02-23T16:41:38.883
26

I always see people using Thread.Sleep() for creating delays in processing or something similar and people are always derided for using it this way.

When is it sensible/required to use Thread.Sleep()?

Edit
Report

1 Answer

-2

if you want a thread to stop doing something, somethimes when you make a endless loop, you don t want the loop to go non stop, because it will also take lots of CPU power, adding a thread.sleep in it will make the loop "take a break" and give the cpu some rest ^^.

answered 2012-02-23T16:45:24.687

Your Answer