class Rufus::Scheduler
def start
Starts this scheduler (or restart it if it was previously stopped)
def start @stopped = false @scheduler_thread = Thread.new do Thread.current[:name] = @thread_name if defined?(JRUBY_VERSION) require 'java' java.lang.Thread.current_thread.name = @thread_name end loop do break if @stopped t0 = Time.now.to_f step d = Time.now.to_f - t0 # + @correction next if d > @precision sleep(@precision - d) end end end