Method: OneApm::Support::EventLoop::Timer#calculate_next_fire_time

Defined in:
lib/one_apm/support/event/timer.rb

#calculate_next_fire_timeObject



31
32
33
34
35
36
37
38
39
# File 'lib/one_apm/support/event/timer.rb', line 31

def calculate_next_fire_time
  now = Time.now
  return now if @interval == 0
  fire_time = @last_fired_at || now
  while fire_time <= now
    fire_time += @interval
  end
  fire_time
end