Created
March 26, 2010 15:12
-
-
Save shingara/345000 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
in the first timer, 'sleep 10' is obsolete.