timeout (HTTPClient::Timeout)

    # File lib/httpclient/timeout.rb, line 122
        def timeout(sec, ex = nil, &block)
          return yield if sec == nil or sec.zero?
          scheduler = nil
          begin
            scheduler = HTTPClient.timeout_scheduler
            period = scheduler.register(Thread.current, sec, ex)
            yield(sec)
          ensure
            scheduler.cancel(period) if scheduler and period
          end
        end