From: james.d.masters@... Date: 2007-04-15T16:15:05+09:00 Subject: Re: executing a system command and stopping it after a specified duration? On Apr 14, 9:57 pm, Robert La Ferla wrote: > I'd like to run a system command and then stop it after specified > amount of time (in seconds or milliseconds.) What's the best way to > do it? Out of curiosity I probed deeper and it looks like you're looking for Timeout#timeout (see RDoc/ri for more information). Here is an example: require 'timeout' # raises an exception if timeout is met begin Timeout::timeout(5) { sleep 10 } rescue Timeout::Error puts "It timed out!" end