Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
require 'eventmachine'
require 'timeout'
EventMachine.run {
EventMachine::PeriodicTimer.new(10) do
puts "#{Time.now} : I am 10"
sleep 10
end
EventMachine::PeriodicTimer.new(1) do
puts Time.now
end
}

tomquas commented Sep 12, 2013

in the first timer, 'sleep 10' is obsolete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment