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

Why Do We Use JSP Instead of Servlet in Java ?

What are the Differences Between a Vector and an ArrayList in Jav ...

What is the Purpose of Properties File in Java ?

What is Information Hiding in Java ?

How Will You Delete a Cookie in JSP ?