Sha256: 9306e3a158e332e687d42b09d6d11d35979c1b1b04c5a27a947df2ca58f8caa9

Contents?: true

Size: 425 Bytes

Versions: 6

Compression:

Stored size: 425 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

6 entries across 6 versions & 1 rubygems

Version Path
rufus-scheduler-1.0.7 test/dev.rb
rufus-scheduler-1.0.6 test/dev.rb
rufus-scheduler-1.0.11 test/dev.rb
rufus-scheduler-1.0.9 test/dev.rb
rufus-scheduler-1.0.8 test/dev.rb
rufus-scheduler-1.0.10 test/dev.rb