Sha256: 5c6085cc13219ada0fc1360e3902fc3e22212e0a9ee68df58ca1b0832390ec9c
Contents?: true
Size: 424 Bytes
Versions: 1
Compression:
Stored size: 424 Bytes
Contents
#require 'rubygems' require 'rufus/scheduler' s = Rufus::Scheduler.new s.precision = 1.250 #s.precision = 0.250 #s.precision = 30 s.start def compute_dev (s, t0, t1) return 0.0 unless t0 s.precision - (t1 - t0) end tprev = nil tcurr = nil #s.schedule "* * * * * *" do s.schedule "* * * * *" do tprev = tcurr tcurr = Time.new puts "#{tcurr.to_s} #{tcurr.to_f} (#{compute_dev(s, tprev, tcurr)})" end s.join
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rufus-scheduler-1.0.12 | test/dev.rb |