Chethan -

Here is another way to add a generic timeout to any task using the
Timeout class.

require 'timeout'

n = 0

begin
  Timeout::timeout(5) do
    loop do
      puts n
      n += 1
      sleep (0.5)
    end
  end
rescue Timeout::Error
  p "oops timeout!!"
  #~ exit
end

p "the end"

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to