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 are the Uses of Reflection in Java ?

What is the Difference Between an ArrayList and a LinkedList Data ...

What are the Thread-safe Classes in Java Collections Framework ?

What are the Differences Between a Checked and Unchecked Exceptio ...

Why Do We Use Static Initializers in Java ?