Thread.sleep() in a while loop
问题 I notice that NetBeans is warning me about using Thread.sleep() in a while loop in my Java code, so I've done some research on the subject. It seems primarily the issue is one of performance, where your while condition may become true while the counter is still sleeping, thus wasting wall-clock time as you wait for the next iteration. This all makes perfect sense. My application has a need to contact a remote system and periodically poll for the state of an operation, waiting until the