title: Quit threads if take longer than X seconds
body: <p>I'm using Ruby threads like this:</p>
  
  <pre><code>threads = []
  
  for page in pages
    threads &lt;&lt; Thread.new(page) { |myPage|
  
      h = Net::HTTP.new(myPage, 80)
      puts "Fetching: #{myPage}"
      resp, data = h.get('/', nil )
      puts "Got #{myPage}:  #{resp.message}"
    }
  end
  
  threads.each { |aThread|  aThread.join }
  </code></pre>
  
  <p>Let's say I wanted to kill all threads that are still running after a minute. How would I do this?</p>