Can We Use Thread.sleep Method For Real-time Processing in Java ?

Java does not guarantee that Thread.sleep() will cause the thread to sleep for exactly N number of milliseconds. Sometime the thread can sleep for than N number of milliseconds.

In real-time processing we need precise time period for which a thread should run or sleep.

Therefore the invocation of Thread.sleep() method is not recommended for use in real-time processing.



You May Interest

What is a Singleton Class in Java ?

What is the Use of a Dictionary Class in Java ?

What is the Difference Between Queue and Stack Data Structures in ...

How Will You Use Other Java Files of Your Application in JSP Code ...

What is the Difference Between remove Methods of Collection and I ...