• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to keep my program suspended or waited for a specific time?  RSS feed

 
sahar sa
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear,
I have a method that will send me a parameter. but I need it to send the parameter after a specific time e.g:9 second;
Is there any special class which keeps my method waiting or suspending for a speific time? In addition, I want to suspend onlyand only the method which calls the waiting command, not the other methods in the class or the class itself!
Thank you,
Sahar.
 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



or

 
Campbell Ritchie
Marshal
Posts: 56599
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That looks good, but you forgot to mention that Thread.sleep() declares a checked Exception.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!