Method: Timer#initialize

Defined in:
lib/mega/timer.rb

#initialize(time_limit = nil, &block) ⇒ Timer

Returns a new instance of Timer.



81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/mega/timer.rb', line 81

def initialize( time_limit=nil, &block )
  # standard timer
  @start_time = nil
  @end_time = nil
  @total_time = 0
  @runnning = nil
  # for using time limit
  @time_limit = time_limit
  @on_timeout = block
  @current_thread = nil
  @timer_thread = nil
end