• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to wait for a certain amount of idle time ?  RSS feed

 
Raj Ohadi
Ranch Hand
Posts: 316
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In unix script I can easily do system call to idle for a certain amount of time. In java how do I do that ? For example, I want to have a java program running and it prints some messages, I want a 30 second gap between two consecutive messages.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thread.sleep(30000);
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!