Class RunEvery


  • public class RunEvery
    extends java.lang.Object
    Helps to run code every X duration, where the last run time is recorded and will not be run again until the next scheduled time. Useful for logging a progress update every X seconds w/o regard to how much has been processed.
    • Constructor Detail

      • RunEvery

        public RunEvery​(long everyMillis)
    • Method Detail

      • runEvery

        public static RunEvery runEvery​(long everyMillis)
      • runEvery

        public static RunEvery runEvery​(java.time.Duration everyDuration)
      • isRunnable

        public boolean isRunnable()
      • ifRunnable

        public void ifRunnable​(java.lang.Runnable runnable)
      • ifRunnable

        public void ifRunnable​(java.util.function.Consumer<java.lang.Long> runnable)