anchor.diff:      {Time, State1} = TimeFun(State),
       {NewRate, Done, State2} = eval_rates(Rate, OldDone, LocalTime, Time, State1),
       ShouldBe = time_of_next_iteration(NewRate, Time, Done + Shift),
  -
       Remain = round(ShouldBe) - LocalTime,
       GotTime = round(Time) - LocalTime,
   
  
positive.code:     -> number().
  time_of_next_iteration(#const_rate{value = undefined}, _, _) -> 0;
  time_of_next_iteration(#const_rate{value = 0}, Duration, _) -> Duration * 2; % should be more than loop length "2" does not stand for anything important
  time_of_next_iteration(#const_rate{value = Rate}, _Duration, IterationNumber) ->
      (IterationNumber * 1000) / Rate;
  time_of_next_iteration(#linear_rate{from = Rate, to = Rate}, _, IterationNumber) ->
      (IterationNumber * 1000) / Rate;
  time_of_next_iteration(#linear_rate{from = StartRPS, to = FinishRPS}, RampDuration, IterationNumber) ->
      % This function solves the following equation for Elapsed:
      %
  
negative.code:             poisson = Poisson
          },
      case mzbl_ast:find_operation_and_extract_args(rate, LoopSpec, [#constant{value = undefined, units = rps}]) of
          [#constant{value = _, units = _} = RPS] ->
              RPSFun = Evaluator(RPS),
              looprun(TimeFun, #const_rate{rate_fun = RPSFun}, Body, WorkerProvider, State4, Env, Opts);
  