Class: Appium::Core::Wait::Timer
- Inherits:
-
Object
- Object
- Appium::Core::Wait::Timer
- Defined in:
- lib/appium_lib_core/common/wait/timer.rb
Instance Method Summary collapse
- #current_time ⇒ Object
-
#initialize(timeout) ⇒ Timer
constructor
A new instance of Timer.
- #timeout? ⇒ Boolean
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_time ⇒ Object
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
23 24 25 |
# File 'lib/appium_lib_core/common/wait/timer.rb', line 23 def timeout? current_time > @end_time end |