Creates a periodic timer
n = 0 timer = EventMachine::PeriodicTimer.new(5) do puts "the time is #{Time.now}" timer.cancel if (n+=1) > 5 end
Create a new periodic timer that executes every interval seconds
# File lib/em/timers.rb, line 31 31: def initialize interval, callback=nil, &block 32: @interval = interval 33: @code = callback || block 34: @cancelled = false 35: schedule 36: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.