class Rufus::Scheduler::CronLine

def brute_frequency


based cronline...
Of course, this method can get VERY slow if you call on it a second-

of a whole year and keeps the shortest.
sunday). This method takes no chance and runs next_time for the span
(the shortest delta is the one between the second sunday and the third
Consider "* * * * sun#2,sun#3", the computed frequency is 1 week

five minutes. Why does this method look at a whole year of #next_time ?
For a simple cronline like "*/5 * * * *", obviously the frequency is

.

schedule described by this cronline.
Returns the shortest delta between two potential occurences of the
def brute_frequency
  key = "brute_frequency:#{@original}"
  delta = self.class.cache[key]
  return delta if delta
  delta = 366 * DAY_S
  t0 = previous_time(Time.local(2000, 1, 1))
  loop do
    break if delta <= 1
    break if delta <= 60 && @seconds && @seconds.size == 1
    t1 = next_time(t0)
    d = t1 - t0
    delta = d if d < delta
    break if @months == nil && t1.month == 2
    break if t1.year >= 2001
    t0 = t1
  end
  self.class.cache[key] = delta
end