diff --git a/features/step_definitions/flatware_steps.rb b/features/step_definitions/flatware_steps.rb index 1728508..69711f1 100644 --- a/features/step_definitions/flatware_steps.rb +++ b/features/step_definitions/flatware_steps.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +require 'benchmark' require 'etc' # helper methods available in all steps @@ -27,11 +28,8 @@ def flatware_process all_commands.find { |command| command.commandline.include? 'flatware' } end - def duration(&_block) - started_at = Time.now - yield - ensure - Time.now - started_at + def duration(&block) + Benchmark.realtime(&block) end end World(Support)