Class Clock.FixedTimeExecutor

    • Constructor Detail

      • Clock.FixedTimeExecutor

        Clock.FixedTimeExecutor(Long executeEveryNanos, Integer repeats, Function0<Unit> func)
        Parameters:
        repeats - how many times to repeat before stopping.
      • Clock.FixedTimeExecutor

        Clock.FixedTimeExecutor(Long executeEveryNanos, Function0<Unit> func)
    • Method Detail

      • getCycles

         final Integer getCycles()

        amount of times this has executed. Only incremented when repeats is not 0 (i.e. it does not last forever) to prevent numerical overflow and keep method short.

      • tick

         Long tick(Long deltaTimeNanos)

        Update this Executor.

        Returns:

        the time remaining until the next execution, or a negative number if it no longer needs to be executed and can be removed.