aspose file tools*
The moose likes Threads and Synchronization and the fly likes Thread.sleep in loop Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply locked New topic
Author

Thread.sleep in loop

Isaac Hewitt
Ranch Hand

Joined: Jul 24, 2006
Posts: 191

I just began using NetBeans 6.9 and it has new hints available to the programmer. One of my classes is a lowe level thread that sleep every 5 seconds after which it verifies the introduction of any USB memory devices into Windows. NetBeans hints to me that a sleep call with a while loop can be dicey, well not exactly in those words. The class functions correctly and there is no noticeable decline in performance of the program. I don't see any other way around the way I have cided the calss below:

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61761
    
  67

Please take care to post a question just once. Thanks.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Thread.sleep in loop