About 60 results
Open links in new tab
  1. How to set a Timer in Java? - Stack Overflow

    Oct 28, 2010 · How to set a Timer, say for 2 minutes, to try to connect to a Database then throw exception if there is any issue in connection?

  2. Creating a repeating timer reminder in Java - Stack Overflow

    Jan 29, 2012 · Use timer.scheduleAtFixedRate() to schedule it to recur every two seconds: Schedules the specified task for repeated fixed-rate execution, beginning at the specified time.

  3. Make a simple timer in Java - Stack Overflow

    A timer with a display would involve threading. If you're new to Java, and perhaps programming in general, I recommend learning simpler stuff first before diving into threading.

  4. Timer & TimerTask versus Thread + sleep in Java - Stack Overflow

    Nov 20, 2014 · From the Timer documentation: Java 5.0 introduced the java.util.concurrent package and one of the concurrency utilities therein is the ScheduledThreadPoolExecutor …

  5. java - How to use Timer class to call a method, do something, …

    Timer ScheduledExecutorService scheduleAtFixedRate scheduleWithFixedDelay Javadocs Java 5.0 introduced the java.util.concurrent package and one of the concurrency utilities therein is …

  6. How to use Java.Util.Timer - Stack Overflow

    I want to make a simple program that counts seconds up until 100 using Java.Util.Timer The code below is the code I am using, however it simply prints all the numbers out at once without …

  7. timer - Run a java function after a specific number of seconds

    Dec 14, 2022 · new java.util.Timer().schedule( new java.util.TimerTask() { @Override public void run() { // your code here } }, 5000 ); EDIT: javadoc says: After the last live reference to a Timer …

  8. How to schedule a periodic task in Java? - Stack Overflow

    I need to schedule a task to run in at fixed interval of time. How can I do this with support of long intervals (for example on each 8 hours)? I'm currently using java.util.Timer.scheduleAtFixedRa...

  9. multithreading - Timer in Java Thread - Stack Overflow

    Jul 29, 2012 · Java 5.0 introduced the java.util.concurrent package and one of the concurrency utilities therein is the ScheduledThreadPoolExecutor which is a thread pool for repeatedly …

  10. How I can run my TimerTask everyday 2 PM? - Stack Overflow

    Feb 21, 2012 · I want to execute a job everyday 2PM. Which method of java.util.Timer I can use to schedule my job? After 2Hrs, run it will stop the job and reschedule for next day 2PM.