code: public PeriodicEvent runEvery(Runnable task, float delay, float period,
              int repetitions) {
          if (repetitions < 1) {
              return null;
          } else if (repetitions == 1) {
              // Better to burn a handful of CPU cycles than to churn memory by
              // creating a new callback
              return runAfter(task, delay);
          } else {
              return runEvery(task, delay, period, new RunFor(repetitions));
          }
      }
docs: Run a task periodically, for a set number of times.
  
  @param task
  Task to run.
  @param delay
  The first execution will happen in {@code delay} seconds.
  @param period
  Subsequent executions will happen every {@code period} seconds
  after the first.
  @param repetitions
  Repeat count
  @return {@code null} if {@code repetitions < 1}; otherwise, an interface
  that lets you query the status; cancel; or reschedule the event.