Class: Appium::Core::Wait::Timer

Inherits:
Object
  • Object
show all
Defined in:
lib/appium_lib_core/common/wait/timer.rb

Instance Method Summary collapse

Constructor Details

#initialize(timeout) ⇒ Timer

Returns a new instance of Timer


19
20
21
# File 'lib/appium_lib_core/common/wait/timer.rb', line 19

def initialize(timeout)
  @end_time = current_time + timeout
end

Instance Method Details

#current_timeObject


28
29
30
# File 'lib/appium_lib_core/common/wait/timer.rb', line 28

def current_time
  Process.clock_gettime(Process::CLOCK_MONOTONIC)
end

#timeout?Boolean

Returns:

  • (Boolean)

23
24
25
# File 'lib/appium_lib_core/common/wait/timer.rb', line 23

def timeout?
  current_time > @end_time
end