# File lib/puppet/external/event-loop/event-loop.rb, line 263
263:   def initialize (options={}, &handler)
264:     @running = false
265:     @start_time = nil
266: 
267:     options = { :interval => options } if options.kind_of? Numeric
268: 
269:     if options[:interval]
270:       @interval = options[:interval].to_f
271:     else
272:       @interval = DEFAULT_INTERVAL
273:     end
274: 
275:     if options[:tolerance]
276:       @tolerance = options[:tolerance].to_f
277:     elsif DEFAULT_TOLERANCE < @interval
278:       @tolerance = DEFAULT_TOLERANCE
279:     else
280:       @tolerance = 0.0
281:     end
282: 
283:     @event_loop = options[:event_loop] || EventLoop.current
284: 
285:     if block_given?
286:       add_signal_handler(:alarm, &handler)
287:       start unless options[:start?] == false
288:     else
289:       start if options[:start?]
290:     end
291:   end