tags:

views:

14

answers:

2

How I can configure servlet to response with some delay for GET or POST, without using Thread.sleep()?

A: 

Do some CPU-intensive task, like calculating Pi with a high precision or a factorial of a big number.

BalusC
+1  A: 

Use Object.wait():

synchronized (this) { this.wait (1000); }

These are the only two ways to wait in Java. Everything else will finally use sleep() or wait().

Aaron Digulla