Skip to content

Instantly share code, notes, and snippets.

@shingara
Created March 26, 2010 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shingara/345000 to your computer and use it in GitHub Desktop.
Save shingara/345000 to your computer and use it in GitHub Desktop.
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
Copy link

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