From: Chuckl Date: 2004-12-10T00:52:27+09:00 Subject: Timeout Idiom This idiom has been a decent shortcut for my work: require 'timeout' def timeout?(sec) begin freq = [0.01, sec / 1000].max timeout(sec) { while true return false if yield sleep(freq) end } rescue Timeout::Error return true end end Code police may even approve, since 'timeout.rb' kinda uses exception-throwing as flow control.