Skip to content

Instantly share code, notes, and snippets.

@benlangfeld
Created May 5, 2011 15:48
Show Gist options
  • Save benlangfeld/957291 to your computer and use it in GitHub Desktop.
Save benlangfeld/957291 to your computer and use it in GitHub Desktop.
t = Time.now
[1,2,3].each do |n|
puts "Working on #{n}"
t_answer = false
while true
if ((Time.now - t) > 10)
puts "10 seconds elapsed"
t_answer = true
break
end
end
break if t_answer
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment