Skip to content

Instantly share code, notes, and snippets.

@funny-falcon
Created March 14, 2012 05:27
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 funny-falcon/2034289 to your computer and use it in GitHub Desktop.
Save funny-falcon/2034289 to your computer and use it in GitHub Desktop.
Test next_tick loop and timer
require 'eventmachine'
EM.run do
i = 0
myloop = ->{
puts i
i += 1
EM.next_tick(myloop)
}
EM.next_tick(myloop)
EM.add_timer(0.001){EM.stop}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment