About 5,330,000 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 · EDIT: Relating to internal execution thread for a Timer that executes a single task once: After the last live reference to a Timer object goes away and all outstanding tasks have completed …

  3. Timer & TimerTask versus Thread + sleep in Java

    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 which is a thread pool …

  4. 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.

  5. How do I time a method's execution in Java? - Stack Overflow

    How do I get a method's execution time? Is there a Timer utility class for things like timing how long a task takes, etc? Most of the searches on Google return results for timers that schedule

  6. 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...

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

    Oct 10, 2021 · 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 object goes …

  8. 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 executing tasks at …

  9. java - How to use Timer class to call a method, do something, reset ...

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

  10. 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 waiting a ...