Method: Roi#precise_time_to_transition

Defined in:
lib/roi/roi.rb

#precise_time_to_transition(args = {}) ⇒ Object

Public: Measures the precise time for the given Roi to transition from false to true to false.

Corresponds to: api_hp_time_for_<ROI TYPE>_transition

key - String key press to trigger evaluation (default: nil).

If default, no key will be pressed.

delay - Integer total milliseconds to delay before starting evaluation (default: 0). timeout - Integer total milliseconds to allow before timing out (default: nil).

If default, timeout will be calculated as [ delay + 5000 ].

expected - Array of expected transition values (default: [true, false]). scale - Boolean if the larger image should be scaled to the size of the smaller image (default: false).

Applies to image ROIs only.

priority - Symbol evaluation priority used to throttle CPU usage (default: :normal):

:critical   - Sleep 10 ms between intensive tasks (USE SPARINGLY)
:high       - Sleep 100 ms between intensive tasks
:normal     - Sleep 1 second between intensive tasks
:low        - Sleep 10 seconds between intensive tasks
:background - Sleep 1 minute between intensive tasks (USE SPARINGLY)

log_every - Integer total milliseconds between logs (default: 1000). report - Boolean indicating whether to report measurements to ITMS (default: true).

Returns the Float total milliseconds for the Roi to transition.



451
452
453
454
455
456
457
458
# File 'lib/roi/roi.rb', line 451

def precise_time_to_transition(args={})
  logger.info("Measuring precise time for #{self.class.name} to transition")
  args[:expected] ||= [true, false]
  args[:precise] = true
  measure(args) do |frame|
    displayed?(:frame => frame, :set_roi_options => args)
  end
end