Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Using java.util.Timer  RSS feed

 
Paul Keohan
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to use a Timer with a TimerTask and the concept seems relatively straightforward. I'm having problems trying to start and stop the TimerTask. How can I creat a Thread that I can start, stop, re-start, stop, re-start etc. as many times as I like with no terrible consequences?
I've looked into extending Thread, and using Timer/TimerTask but they all fall short.
Thanks.
Paul
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!