When polling in Java, use Thread.sleep or yield.

Printable View