Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

ruby timeout

begin
  Timeout.timeout(5) do
    # logic
    sleep 10
    puts "End of processing"
  end
rescue Timeout::Error
  puts "Took longer than 5 seconds!"
end
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #ruby #timeout
ADD COMMENT
Topic
Name
4+6 =