class TypeProf::Utils::TimerCancelToken

Public Class Methods

new(max_sec) click to toggle source
# File typeprof-0.21.11/lib/typeprof/utils.rb, line 202
def initialize(max_sec)
  @max_sec = max_sec
  @start_time = Time.now
end

Public Instance Methods

cancelled?() click to toggle source
# File typeprof-0.21.11/lib/typeprof/utils.rb, line 207
def cancelled?
  @max_sec && Time.now - @start_time >= @max_sec
end