def add(duration, metainfo = nil, recurring = true, immed = false)
      raise "TimerManager.add: Timer duration may not be nil" if duration.nil?
      info = TimerInfo.new(duration, recurring, metainfo)
      info.expiry = Time.new if immed
      @mutex.synchronize{ @queue.push info }
      info
    end
def add(duration, metainfo = nil, recurring = true, immed = false)
      raise "TimerManager.add: Timer duration may not be nil" if duration.nil?
      info = TimerInfo.new(duration, recurring, metainfo)
      info.expiry = Time.new if immed
      @mutex.synchronize{ @queue.push info }
      info
    end
Add a timer. Parameter 'duration' specifies the timer duration in seconds,
 'metainfo' is caller information passed to the handler when the timer expires,
 'recurring' should be true if the timer will repeat, or false if it will only
 expire once, and 'immed' when true specifies that the timer should expire immediately
 (and again each duration if recurring) while false specifies that the timer will only
 expire the first time after it's duration elapses.