def scheduleTimer(duration, metainfo = nil, recurring = true, immed = false)
      timerInfo = @timerManager.add(duration, metainfo, recurring, immed)
      # This timer may expire sooner than the current sleep we are doing in select(). To make
      # sure we will write to the event pipe to break out of select().
      if @currentEventPipeChars == 0
        @eventWrite.write 'x'
        @currentEventPipeChars += 1
        @eventWrite.flush
      end
      timerInfo
    end
def scheduleTimer(duration, metainfo = nil, recurring = true, immed = false)
      timerInfo = @timerManager.add(duration, metainfo, recurring, immed)
      # This timer may expire sooner than the current sleep we are doing in select(). To make
      # sure we will write to the event pipe to break out of select().
      if @currentEventPipeChars == 0
        @eventWrite.write 'x'
        @currentEventPipeChars += 1
        @eventWrite.flush
      end
      timerInfo
    end
Schedule 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.