def start
      raise AlreadyRunning.new unless @timer_thread.nil?
      @stop_timer = false
      @timer_thread = Thread.new do
        begin
          until @stop_timer do
            to_sleep = get_min_sleep
            if((to_sleep.nil? || to_sleep > 0) && @new_actions.empty?)
              @awake_lock.unlock if @awake_lock.locked?
              start = Time.now.to_f
              to_sleep.nil? ? @sleeper.wait : sleep(to_sleep)
              actual_sleep = Time.now.to_f - start
              if(@delta && to_sleep && actual_sleep.within_delta?(:expected => to_sleep, :delta => @delta))
                actual_sleep = to_sleep
              end
              @awake_lock.lock
            else
              actual_sleep = 0
            end
            tick(actual_sleep)
            add_waiting_actions
          end
        rescue Object => boom
          @timer_thread = nil
          clean_actions
          @logger.fatal("Timer encountered an unexpected error and is shutting down: #{boom}\n#{boom.backtrace.join("\n")}")
          @respond_to.raise boom
        end
      end
    end
def start
      raise AlreadyRunning.new unless @timer_thread.nil?
      @stop_timer = false
      @timer_thread = Thread.new do
        begin
          until @stop_timer do
            to_sleep = get_min_sleep
            if((to_sleep.nil? || to_sleep > 0) && @new_actions.empty?)
              @awake_lock.unlock if @awake_lock.locked?
              start = Time.now.to_f
              to_sleep.nil? ? @sleeper.wait : sleep(to_sleep)
              actual_sleep = Time.now.to_f - start
              if(@delta && to_sleep && actual_sleep.within_delta?(:expected => to_sleep, :delta => @delta))
                actual_sleep = to_sleep
              end
              @awake_lock.lock
            else
              actual_sleep = 0
            end
            tick(actual_sleep)
            add_waiting_actions
          end
        rescue Object => boom
          @timer_thread = nil
          clean_actions
          @logger.fatal("Timer encountered an unexpected error and is shutting down: #{boom}\n#{boom.backtrace.join("\n")}")
          @respond_to.raise boom
        end
      end
    end
Start the timer