Sha256: d24c5f21064806ef23c1a6100c2a9761e85b76ba186d1020883cda34d48a52f2

Contents?: true

Size: 400 Bytes

Versions: 19

Compression:

Stored size: 400 Bytes

Contents


def rwhen (expr, diffSec = 0)
	while true
		yield
		waitSec = nil
		IO.popen "rwhen.rb '#{expr}' #{$PROGRAM_NAME}" do |fr|
			waitSec = (fr.gets || break).chomp.to_f
		end
		if $?.to_i != 0 || waitSec == nil
			raise ArgumentError.new("failed to calculate the execution time by rwhen\n")
		end
		if $DEBUG
			require 'Yk/debugout'
			er waitSec + diffSec
		end
		sleep waitSec + diffSec
	end
end


Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
YkLib-0.1.8.9 lib/Yk/rwhen.rb
YkLib-0.1.8.8 lib/Yk/rwhen.rb
YkLib-0.1.8.7 lib/Yk/rwhen.rb
YkLib-0.1.8.6 lib/Yk/rwhen.rb
YkLib-0.1.8.5 lib/Yk/rwhen.rb
YkLib-0.1.8.4 lib/Yk/rwhen.rb
YkLib-0.1.8.3 lib/Yk/rwhen.rb
YkLib-0.1.8.2 lib/Yk/rwhen.rb
YkLib-0.1.8.1 lib/Yk/rwhen.rb
YkLib-0.1.8 lib/Yk/rwhen.rb
YkLib-0.1.7.1 lib/Yk/rwhen.rb
YkLib-0.1.7 lib/Yk/rwhen.rb
YkLib-0.1.6 lib/Yk/rwhen.rb
YkLib-0.1.5 lib/Yk/rwhen.rb
YkLib-0.1.4 lib/Yk/rwhen.rb
YkLib-0.1.3 lib/Yk/rwhen.rb
YkLib-0.1.2 lib/Yk/rwhen.rb
YkLib-0.1.1 lib/Yk/rwhen.rb
YkLib-0.1.0 lib/YkLib/Yk/rwhen.rb