module Scoutui::Commands class Sleep < Command def execute(drv=nil, e=nil) rc=false _req = Scoutui::Utils::TestUtils.instance.getReq() Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " Sleep.execute(#{@cmd})" begin s=nil if @cmd.match(/sleep\s*\((.*)\)/) s = @cmd.match(/sleep\s*\((.*)\)/)[1].to_s.strip end msec = s.to_f puts __FILE__ + (__LINE__).to_s + " start sleep: #{Time.now}" sleep msec puts __FILE__ + (__LINE__).to_s + " end sleep: #{Time.now}" rc=true rescue => ex Scoutui::Logger::LogMgr.instance.warn __FILE__ + (__LINE__).to_s + " Error during processing: #{$!}" Scoutui::Logger::LogMgr.instance.warn "Backtrace:\n\t#{ex.backtrace.join("\n\t")}" end setResult(rc) end end end